Skip to content

Security: No server-side validation that sender belongs to target conversation/world#296

Open
tuanaiseo wants to merge 1 commit into
a16z-infra:mainfrom
tuanaiseo:contribai/fix/security/no-server-side-validation-that-sender-be
Open

Security: No server-side validation that sender belongs to target conversation/world#296
tuanaiseo wants to merge 1 commit into
a16z-infra:mainfrom
tuanaiseo:contribai/fix/security/no-server-side-validation-that-sender-be

Conversation

@tuanaiseo

Copy link
Copy Markdown

Problem

The writeMessage mutation inserts a message for arbitrary worldId and conversationId values without checking that the conversation exists in that world and that the sending player is an active participant. This enables unauthorized message injection across conversations/worlds.

Severity: high
File: convex/messages.ts

Solution

Before inserting, load the world/conversation state and verify: (1) conversation exists in worldId, (2) sender is an active participant, and (3) sender is authorized user identity. Reject on any mismatch.

Changes

  • convex/messages.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The `writeMessage` mutation inserts a message for arbitrary `worldId` and `conversationId` values without checking that the conversation exists in that world and that the sending player is an active participant. This enables unauthorized message injection across conversations/worlds.

Affected files: messages.ts

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant