Skip to content

[Crash] Unchecked msg.currentKills numeric operation in addKill handler #68

@coderabbitai

Description

@coderabbitai

Summary

Services server produces NaN when msg.currentKills is undefined, corrupting streak data.

Affected Code

server-services/start-services.js:398

userData.streak = Math.max(msg.currentKills, userData.streak || 0);
// NaN if msg.currentKills undefined

Vulnerability

If client sends {"cmd":"addKill"} without currentKills field.

Impact

  • User streak corruption (becomes NaN)
  • Database integrity issue

Proof of Concept

{"cmd":"addKill","session":"valid_session"}

Recommended Fix

const currentKills = parseInt(msg.currentKills) || 0;
userData.streak = Math.max(currentKills, userData.streak || 0);

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions