Skip to content

[Crash] Unchecked this.room.perm.inputCmd in chat message handler #52

@coderabbitai

Description

@coderabbitai

Summary

Game server crashes when this.room.perm is undefined during command processing.

Affected Code

server-game/src/client.js:345

if (text.startsWith("/")) {
  this.room.perm.inputCmd(this.player, text); // CRASH if this.room.perm is undefined

Vulnerability

If room initialization fails or race condition during shutdown, this.room.perm may be undefined.

Impact

  • Game server crash when player types command
  • Denial of service

Recommended Fix

if (text.startsWith("/")) {
  this.room.perm?.inputCmd(this.player, text);

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