High severity · published Oct 6, 2025
CVE-2025-59152
X-Forwarded-For Header Spoofing Bypasses Litestar Rate Limiting
7.5
CVSS
0.5%
EPSS
No
On KEV
Description
Litestar is an Asynchronous Server Gateway Interface (ASGI) framework. In version 2.17.0, rate limits can be completely bypassed by manipulating the X-Forwarded-For header. This renders IP-based rate limiting ineffective against determined attackers. Litestar's RateLimitMiddleware uses `cache_key_from_request()` to generate cache keys for rate limiting. When an X-Forwarded-For header is present, the middleware trusts it unconditionally and uses its value as part of the client identifier. Since clients can set arbitrary X-Forwarded-For values, each different spoofed IP creates a separate rate limit bucket. An attacker can rotate through different header values to avoid hitting any single bucket's limit. This affects any Litestar application using RateLimitMiddleware with default settings, which likely includes most applications that implement rate limiting. Version 2.18.0 contains a patch for the vulnerability.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
None
Integrity
None
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.5% · higher than 42% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
LI
litestar · litestar-org
= 2.17.0 · source: vendor
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2025-59152
CVE.org
https://www.cve.org/CVERecord?id=CVE-2025-59152
github.com
https://github.com/litestar-org/litestar/blob/26f20ac6c52de2b4bf81161f7560c8bb4af6f382/litestar/middleware/rate_limit.py#L127
github.com
https://github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb
github.com
https://github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c
More from litestar
8.3
CVE-2024-42370
Litestar repository vulnerable to Environment Variable injection in `docs-preview.yml` workflow
8.2
CVE-2024-32982
Litestar and Starlite affected by Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
8.1
CVE-2026-48060
Litestar: HTML Injection Through CSRF Token
7.5
CVE-2024-52581
Litestar allows unbounded resource consumption (DoS vulnerability)
6.5
CVE-2026-25480
FileStore key canonicalization collisions allow response cache mixup/poisoning (ASCII ord + Unicode NFKD)
