🐛(Bug) AI user rate limit can be bypassed by spoofing X-Forwarded-For
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 17k
- Forks
- 705
- Merge medio
- 4 d 13 h
- PR fusionados (30 d)
- 47
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de suitenumerique/docs
-
🐛(Bug) Helm chart is published from a push to any branch, not only mainPosiblemente ocupada @RoeeSivan la tomó hace 1 día. AbiertoAI generated CI helm
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
suitenumerique/docs#3049 ·
Los mantenedores suelen responder en 3 días
-
🐛(Bug) Preview comment missing when a PR is opened or labelled with a conflictPosiblemente ocupada @RoeeSivan la tomó hace 1 día. AbiertoCI preview
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
suitenumerique/docs#3039 ·
Los mantenedores suelen responder en 3 días
-
AI generated frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
suitenumerique/docs#3030 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
🐛(Bug) Block menu shows an orphan separator on blocks without colors (math, diagram)Posiblemente ocupada @arxh80 la tomó hace 8 días. Abiertofrontend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
suitenumerique/docs#3021 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
suitenumerique/docs#3018 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de suitenumerique/docs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
siyuan-note/siyuan#21692 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
GetStream/stream-chat-react#3467 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
resend/resend-node#1206 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cloudflare-typescript#2821 ·