fix: the token id resolution functions (rideableutils in RidingScript.js - #151
fix: the token id resolution functions (rideableutils in RidingScript.js#151anupamme wants to merge 2 commits into
Conversation
Automated security fix generated by OrbisAI Security
|
I see two problems with this PR:
|
Replace the unverifiable pUserID permission check in UpdateRidderTokensRequest with a game-state allowlist (only rider IDs already flagged on the ridden token are accepted), removing reliance on an attacker-controlled payload field. Force pRidingOptions.isGM = false in the GM-side MountRequest socket handler so a player cannot set isGM: true in the payload to bypass PreventEnemyRiding. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
addressed. pls review. |
|
Checking against the known riders of the mount seems more robust and a good idea. I am not quite sure what the purpose of the changes in |
|
Makes sense, thanks! Checking inside UpdateRidderTokens against the known riders (via RideableFlags.isRiddenby) is better than my TokenfromID/early-return approach anyway, since it naturally handles the "empty list = update all current riders" case instead of me having to special-case it. Glad to hear you'll fold that into the next release. |
Summary
Fix high severity security issue in
scripts/RidingScript.js.Vulnerability
V-001scripts/RidingScript.js:226Description: The token ID resolution functions (RideableUtils.TokenfromID and RideableUtils.TokensfromIDs) are called with user-supplied IDs from WebSocket messages without verifying that the requesting user has permission to access or modify those tokens. While the code checks if the user is a GM (game.user.isGM), non-GM users can still send WebSocket messages with arbitrary token IDs. The GM check only determines if the local user is a GM, but the socket message could be processed by a GM client on behalf of a non-GM sender.
Evidence
Scanner confirmation: multi_agent_ai rule
V-001flagged this pattern.Changes
scripts/RidingScript.jsBehavior Preservation
The change is scoped to 1 file on the vulnerable path, and the project's existing tests still pass, so intended behavior is unchanged.
Verification
Automated security fix by OrbisAI Security