GHSA-HM8G-XG6V-JJG9
Rate limiting silently fell back to a per-process window on any Redis failure, ignoring redis_fail_open and multiplying the effective limit by the worker count
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-HM8G-XG6V-JJG9 divulgada · CVSS 3.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`_redis_request_count` in `guard_core/handlers/ratelimit_handler.py` caught every Redis error (including `GuardRedisError` from a failed connection), logged it, and returned no count, so both `check_rate_limit` (the HTTP pipeline) and `check_rate_limit_by_ip` (websocket and framework-agnostic callers) fell back to the in-memory per-process window. `redis_fail_open` (default `False`) documents fail-closed behaviour on Redis failure for every check, but the rate limiter never raised.
Impact
During a Redis outage, or when a Redis-down state is induced, a deployment with N workers enforces N times its configured rate limit per client, and the shared window that bans and auto-ban counters depend on is gone, with only an error log line per request as the signal. An operator who chose `redis_fail_open=False` expecting requests to fail closed during an outage got the weaker limit instead.
Affected
All guard-core versions up to and including 3.14.0 with `enable_redis=True`.
Fixed in 3.15.0
Fixed in guard-core 3.15.0 https://github.com/rennf93/guard-core/releases/tag/3.15.0 (PyPI https://pypi.org/project/guard-core/3.15.0/), merged in #83 https://github.com/rennf93/guard-core/pull/83 (75d13343). `redis_fail_open=False`: the rate limiter raises `GuardRedisError`; the pipeline applies `fail_secure` (500 under fail-secure, pass-through otherwise) and fastapi-guard's websocket guard closes 1013. `redis_fail_open=True`: the in-memory window is used with one warning per process. Labelled Breaking in the 3.15.0 changelog.
Credit
Found by the maintainers while verifying the websocket integration for a downstream project.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
PyPIguard-core |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/Guard-Core/guard-core/security/advisories/GHSA-hm8g-xg6v-jjg9Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
