CVE-2025-59152: Litestar X-Forwarded-For Header Spoofing Vulnerability Enables Rate Limit Evasion
(updated )
While testing Litestar’s RateLimitMiddleware, I discovered that rate limits can be completely bypassed by manipulating the X-Forwarded-For header. This renders IP-based rate limiting ineffective against determined attackers.
References
- github.com/advisories/GHSA-hm36-ffrh-c77c
- github.com/litestar-org/litestar
- github.com/litestar-org/litestar/blob/26f20ac6c52de2b4bf81161f7560c8bb4af6f382/litestar/middleware/rate_limit.py
- github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb
- github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c
- nvd.nist.gov/vuln/detail/CVE-2025-59152
Code Behaviors & Features
Detect and mitigate CVE-2025-59152 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →