CVE-2025-59152: litestar · Reliance on Untrusted Inputs in a Security Decision
Affects litestarSource CVE Database V5
Not known to be exploited · CVSS 7.5 High.
Data as of 26 Oct 2026, 15:59 UTC
- EPSS
- 0.4% chance of exploitation in 30 days – higher than 41% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HExploitation evidence
Disclosed: evidence found.
CVE published 6 Oct 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| litestar-org litestar | Affected
| Fixed in– |
AI-suggested
European organizations should immediately upgrade Litestar to version 2.18.0 or later, which contains the patch for this vulnerability. Until the upgrade is applied, organizations should implement additional controls to validate or sanitize the X-Forwarded-For header before it is used for rate limiting. This can include configuring middleware to trust only headers from known and secure proxies or load balancers, ignoring client-supplied X-Forwarded-For headers from untrusted sources, or using alternative client identification methods such as authenticated tokens or cookies. Network-level protections like Web Application Firewalls (WAFs) can be configured to detect and block suspicious header manipulation or IP rotation patterns. Monitoring and alerting on unusual request rates or header anomalies can help detect exploitation attempts early. Additionally, consider implementing rate limiting based on multiple factors (e.g., user accounts, API keys) rather than solely on IP addresses. Conduct thorough testing after applying patches or configuration changes to ensure rate limiting functions as intended without introducing regressions.
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.
References
- github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c (opens in a new tab)
- github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb (opens in a new tab)
- github.com/litestar-org/litestar/blob/26f20ac6c52de2b4bf81161f7560c8bb4af6f382/litestar/middleware/rate_limit.py (opens in a new tab)