[BUG]: Non-team transcript submission trusts client-supplied opponent transcripts and emails, allowing rating forgery

Aperta
#806 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, mongodb, redis

Direzione di ricerca

Start with backend/controllers/transcript_controller.go:22-78, the request handler named in the regression plan, and trace how it resolves participants and persists transcripts and ratings. Check the existing controller tests and test setup for MongoDB and Redis. Done means submissions cannot choose an opponent or affect users who did not participate, with a regression test covering the reported scenario.

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

Descrizione

bug
Bug Description

SubmitTranscripts accepts opponentRole, opponentEmail, opponentID and opponentTranscripts from the authenticated caller. For non-team rooms it stores them as the opponent's submission, judges the fabricated debate and calls UpdateRatings for both resolved users. No check proves either user participated in the room.

Steps to Reproduce
  1. Authenticate as an attacker.
  2. POST /submit-transcripts with any roomId, role 'for', attacker transcripts designed to win.
  3. Include opponentRole 'against', opponentEmail of the victim, and crafted losing opponentTranscripts.
  4. Repeat with new roomIds; each success stores transcripts, judges the debate and changes both users' Glicko ratings.
Logs and Screenshots

HTTP 200 with judge result; MongoDB gains debate_transcripts and debates rows and users.rating changes for the chosen opponent. Service has no room/participant lookup on this path.

Expected vs actual
  • Expected: The system enforces the invariant described in the remediation below: Resolve both participants from server-side room/debate state, verify the caller belongs to the room and role, and never accept opponent transcripts from the client.
  • Actual: Arbitrary Elo inflation/deflation for any user, forged debate history, corruption of real room transcripts, and abuse of AI quota.
Impact

Critical - Application is unusable

Arbitrary Elo inflation/deflation for any user, forged debate history, corruption of real room transcripts, and abuse of AI quota.

Recommended fix

Resolve both participants from server-side room/debate state, verify the caller belongs to the room and role, and never accept opponent transcripts from the client.

Regression test plan
  • Add a test that exercises the path in backend/controllers/transcript_controller.go:22-78 and asserts that the defect is rejected or handled safely.
  • Reproduce the scenario above against a local backend with MongoDB and Redis; confirm the old behavior fails the assertion and the fixed behavior passes.
  • Run go test ./..., go vet ./... and, for WebSocket/concurrency fixes, go test -race ./....
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
264
Merge medio
6h 53m
PR unite (30g)
8

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.