Summary
Multiple handlers access nested properties without null/undefined checks, allowing clients to crash the server with malformed payloads.
Affected Code (examples)
server-game/start-game.js:230 - msg.servicesMeta.startTime
server-services/start-services.js:189 - ss.config.services.ratelimit.sensitive.cmds
server-game/src/client.js:345-346 - this.room.perm.inputCmd, this.room.censor.detect
server-game/src/client.js:562-569 - this.player.modifiers.* (multiple)
server-services/src/ratelimit.js:37,41,52,56,70,71,84,85 - nested config accesses
Vulnerability
When expected objects/properties are undefined, JavaScript throws TypeError, crashing the process if unhandled.
Impact
- Remote server crash with single crafted message
- Denial of service
Proof of Concept
{"cmd":"requestConfig"} // crashes on msg.servicesMeta.startTime access
Recommended Fix
- Use optional chaining (
?.) for all nested accesses
- Add input validation/schema checks at message boundaries
- Provide safe defaults for config paths
Example:
// Before:
if ((msg.servicesMeta.startTime > ss.config.servicesMeta.startTime) && ss.isPerpetual)
// After:
if ((msg.servicesMeta?.startTime > ss.config.servicesMeta?.startTime) && ss.isPerpetual)
References
Summary
Multiple handlers access nested properties without null/undefined checks, allowing clients to crash the server with malformed payloads.
Affected Code (examples)
server-game/start-game.js:230-msg.servicesMeta.startTimeserver-services/start-services.js:189-ss.config.services.ratelimit.sensitive.cmdsserver-game/src/client.js:345-346-this.room.perm.inputCmd,this.room.censor.detectserver-game/src/client.js:562-569-this.player.modifiers.*(multiple)server-services/src/ratelimit.js:37,41,52,56,70,71,84,85- nested config accessesVulnerability
When expected objects/properties are undefined, JavaScript throws
TypeError, crashing the process if unhandled.Impact
Proof of Concept
Recommended Fix
?.) for all nested accessesExample:
References