[BUG]: IDOR : Missing Ownership Check in ConcedeDebate
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
Direzione di ricerca
Leggi backend/controllers/debatevsbot_controller.go, ConcedeDebate (lines 529-661). Trova come l'email del chiamante viene recuperata dal Gin context, poi limita il FindOne alla linea 557 e l'update filter alla linea 564 per far corrispondere anche debate.Email == caller email. Esegui TestBUG05_IDOR_ConcedeDebate o assert un 403 per cross-user concede. Fatto significa che un attaccante ottiene 403 e il debate del proprietario rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
POST /vsbot/concede accepts a debateId and updates the corresponding debates_vs_bot document to outcome: "User conceded" without verifying that the debate belongs to the authenticated caller.
In backend/controllers/debatevsbot_controller.go:557, the lookup is scoped only by _id:
err = db.DebateVsBotCollection.FindOne(
context.Background(),
bson.M{"_id": objID},
).Decode(&debate)
and the update at backend/controllers/debatevsbot_controller.go:564 is likewise unscoped:
filter := bson.M{"_id": objID}
update := bson.M{"$set": bson.M{"outcome": "User conceded"}}
No comparison is made between debate.Email and the authenticated user's email. Any authenticated user who obtains or guesses another user's debateId can force-concede that debate, overwrite its history with attacker-supplied content, and have a loss transcript/gamification applied to the attacker's own account.
Steps to Reproduce
- Start MongoDB (and Redis) with Docker:
docker start debateai-mongo-1 debateai-redis-1 - Start the backend and authenticate two users: [email protected] and [email protected].
- As the owner, start a bot debate via POST /vsbot/create and record the returned debateId.
- As the attacker, call the concede endpoint with the owner's debateId:
POST /vsbot/concede
Authorization: Bearer <attacker_token>
Content-Type: application/json
{
"debateId": "<OWNER_DEBATE_ID>",
"history": [{"sender": "User", "text": "Attacker injected history"}]
}
- Observe the response and the owner's document:
db.debates_vs_bot.findOne({_id: ObjectId("<OWNER_DEBATE_ID>")})
// outcome: "User conceded", history replaced by attacker-supplied history
Automated reproduction used a temporary test (TestBUG05_IDOR_ConcedeDebate) that inserts an owner-owned debate, authenticates as the attacker, and posts the owner's debateId to ConcedeDebate.
Logs and Screenshots
=== RUN TestBUG05_IDOR_ConcedeDebate
zz_bug05_idor_tmp_test.go:125: [email protected] [email protected] debateId=6adcc1ec0534e1a1696b0b8f
zz_bug05_idor_tmp_test.go:126: HTTP status=200 body={"message":"Debate conceded successfully"}
zz_bug05_idor_tmp_test.go:127: owner debate outcome after attacker request="User conceded" history=1 messages
zz_bug05_idor_tmp_test.go:136: BUG CONFIRMED: attacker conceded another user's debate (HTTP 200, outcome="User conceded")
--- PASS: TestBUG05_IDOR_ConcedeDebate (0.10s)
PASS
ok arguehub/controllers 0.116s
Additional observed side effect: the attacker received +10 points for a loss in the gamification update (updateGamificationAfterBotDebate), because the handler applies the concession to the caller's account rather than the debate owner.
Environment Details
- OS: Linux (x86_64)
- Go: go1.24
- Framework: Gin Gonic v1.9.1
- Database: MongoDB 7.0 (debateai-mongo-1, port 27017)
- Cache: Redis 7-Alpine (debateai-redis-1, port 6379)
- Affected endpoint: POST /vsbot/concede
- Affected file: backend/controllers/debatevsbot_controller.go (ConcedeDebate, lines 529–661; vulnerable lookup line 557, update line 564)
- Severity: High (Broken Access Control / IDOR)
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
- 104
- Fork
- 244
- Merge medio
- 1g 22h
- PR unite (30g)
- 42
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/DebateAI
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
AOSSIE-Org/DebateAI#773 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Header avatar and display name don't update after editing the profileForse già presa @mithunkc017-ship-it l’ha presa 2 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
AOSSIE-Org/DebateAI#770 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Signed-out visitors see a fake account menu ("User", "No email", "Sign out") on public pagesForse già presa @dhruvbit l’ha presa 2 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/DebateAI#769 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
AOSSIE-Org/DebateAI#768 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
AOSSIE-Org/DebateAI#760 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di AOSSIE-Org/DebateAI
Issue simili
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
devdotfast/whiteboard#1415 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area/sessions comp/desktop desktop/sessions P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
NousResearch/hermes-agent#145383 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement p2 setup
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
vercel/eve#5419 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno