[BUG]: Spectators can concede debates and repeatedly modify ratings

Open
#816 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 20 days

@krushna-sahu1 is already working on this.

Since Nov 25, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Trace the 1v1 message dispatcher and handleConcede, then inspect the room phase, participant roles, and rating update path. Reproduce the repeated concede from the issue’s WebSocket steps and identify where server-side state can enforce the stated invariant. Done when only a registered non-spectator can concede once during an active debate and repeated or out-of-phase requests cannot change ratings.

Written by the indexing model from the issue text.

Description

bug
Bug Description

The 1v1 dispatcher routes the 'concede' message from every client to handleConcede. The handler does not reject spectators, does not check room phase, and does not prevent repeated concedes; it picks any non-spectator as opponent and calls UpdateRatings.

Expected vs actual
  • Expected: The system enforces the invariant described in the remediation below: Accept concede only from a registered non-spectator in an active debate, exactly once, and guard with server-side state.
  • Actual: Rating manipulation and collusion; a single spectator can repeatedly boost another user.
Root cause

The message dispatcher forwards concede from every client, and the handler has no role, phase or duplicate-concede guard.

Steps to Reproduce
  1. Connect to /ws?room=&spectator=true&token=.
  2. Send {'type':'concede'} repeatedly.
  3. Observe rating updates on each call even during setup and even from a spectator account.
Logs and Screenshots
Server logs 'Error updating ratings...' only on failure; successful concedes silently change users.rating. No authorization error is returned.
Environment Details

No response

Impact

High - Major feature is broken

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Dominant language
TypeScript
Stars
108
Forks
266
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/DebateAI

All issues in AOSSIE-Org/DebateAI

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.