GHSA-Q5F7-443M-W4RQ
Path-keyed controls (exclude_paths, endpoint_rate_limits, custom checks) silently stop matching under an ASGI root_path or sub-app mount
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-Q5F7-443M-W4RQ divulgada · CVSS 6.5 (GitHub) | |
| Remediación | Parche 7.8.2 | fastapi-guard · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`StarletteGuardRequest.url_path` (and the websocket adapter's request view) returned `request.url.path`, which includes the ASGI `root_path` prefix under `uvicorn --root-path /x` or a sub-application mount. guard-core matches that value against `exclude_paths`, looks it up as an exact key in `endpoint_rate_limits`, and passes it to `custom_request_check` hooks, so every path-keyed control silently stopped applying under a mount. Reproduced on a real server: a route limited to two requests per window answered 429 on the third hit without a root path and never with one.
Impact
An operator who configures per-endpoint rate limits or exclusions for a mounted application gets none of them, with no warning: the limits are simply absent under the mount while the configuration reports them as set. Detection and IP controls were unaffected (they do not key on the path).
Affected
All fastapi-guard versions with the Starlette adapter up to and including 7.8.1, whenever the application runs under a non-empty `root_path` (uvicorn `--root-path`, a reverse proxy setting the ASGI root path, or `app.mount()`).
Fixed in 7.8.2
Fixed in fastapi-guard 7.8.2 https://github.com/rennf93/fastapi-guard/releases/tag/7.8.2 (PyPI https://pypi.org/project/fastapi-guard/7.8.2/), merged in #123 https://github.com/rennf93/fastapi-guard/pull/123 (4dff3112). Both adapters resolve the path with `starlette.routing.get_route_path(scope)`, the same resolution Starlette's router uses, so the route-relative path is what guard-core matches. Migration: keys that were prefixed with the mount path as a workaround must lose the prefix. The package now declares `starlette>=0.35.0` and `fastapi>=0.109.0` because `get_route_path` exists from Starlette 0.35.0.
Credit
Found by the maintainers during the Odysseus perimeter audit (odysseus-dev/odysseus PR #6193); the same class was fixed upstream in Odysseus's own AuthMiddleware (#5807).
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypifastapi-guard |
Corregida | 7.8.2 | 0 d | 8.1.2 no afectada |
7.8.2Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/Guard-Core/fastapi-guard/security/advisories/GHSA-q5f7-443m-w4rqLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
