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

オープン
#806 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, mongodb, redis

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
TypeScript
スター
108
フォーク
264
平均マージ
6時間 53分
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/DebateAI のほかの issue

AOSSIE-Org/DebateAI の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。