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

Aperta
#816 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 20 giorni

@krushna-sahu1 ci sta già lavorando.

Dal 25/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
108
Fork
266
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/DebateAI

Tutte le issue di AOSSIE-Org/DebateAI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.