🐛(Bug) AI user rate limit can be bypassed by spoofing X-Forwarded-For
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
The bypass is in the custom get_ident used by the three AI throttle classes in src/backend/core/api/utils.py, which trusts the first X-Forwarded-For address and ignores NUM_PROXIES. Read how DRF's default get_ident uses NUM_PROXIES, then check the AI_ALLOW_REACH_FROM=public path that makes anonymous AI calls reachable. Done means the classes move to core/api/throttling.py, the custom get_ident is removed, and a test shows that changing X-Forwarded-For does not reset the anonymous AI quota.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
AIUserRateThrottle keys anonymous requests on the first X-Forwarded-For address, which the client controls: varying the header gives a new AI quota each time, and NUM_PROXIES (added by #3005) is ignored.
https://github.com/suitenumerique/docs/blob/c474db77245aba67600135e0cafd85fe80267994/src/backend/core/api/utils.py#L191-L198
It is only reachable anonymously with AI_ALLOW_REACH_FROM=public (not the default), and the per-document limit still applies.
Suggested fix: move the three AI throttle classes to core/api/throttling.py with no behaviour change, then delete the custom get_ident so that DRF's version honours NUM_PROXIES, which deployments must set for the fix to hold.
Keep this throttle keyed on the IP address: the anonymous cookie of #3005 can be renewed by the client, and these are paid LLM calls.
- Lingua principale
- TypeScript
- Stelle
- 17k
- Fork
- 705
- Merge medio
- 4g 13h
- PR unite (30g)
- 47
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la 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 suitenumerique/docs
-
🐛(Bug) Helm chart is published from a push to any branch, not only mainForse già presa @RoeeSivan l’ha presa 1 giorno fa. ApertaAI generated CI helm
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
suitenumerique/docs#3049 ·
I maintainer di solito rispondono entro 3 giorni
-
🐛(Bug) Preview comment missing when a PR is opened or labelled with a conflictForse già presa @RoeeSivan l’ha presa 1 giorno fa. ApertaCI preview
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
suitenumerique/docs#3039 ·
I maintainer di solito rispondono entro 3 giorni
-
AI generated frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
suitenumerique/docs#3030 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
🐛(Bug) Block menu shows an orphan separator on blocks without colors (math, diagram)Forse già presa @arxh80 l’ha presa 8 giorni fa. Apertafrontend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
suitenumerique/docs#3021 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
suitenumerique/docs#3018 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di suitenumerique/docs
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
siyuan-note/siyuan#21692 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
GetStream/stream-chat-react#3467 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
resend/resend-node#1206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/cloudflare-typescript#2821 ·