Litestar CVE-2025-59152
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint protected by RateLimitMiddleware
-
ExploitSend requests with rotating X-Forwarded-For header values
-
ExecutionEach spoofed IP creates a fresh rate-limit bucket
-
ImpactBrute-force credentials or abuse API unthrottled
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Trusted input validation
|
| Exploitation Conditions | The application must be running Litestar 2.17.0 and using RateLimitMiddleware (via RateLimitConfig) with default settings - the default identifier logic trusts the X-Forwarded-For (and X-Real-IP) header unconditionally, so no authentication, privileges, user interaction, or non-default configuration is required to bypass it. The exploit is simply setting a different X-Forwarded-For value per request. LIMITING FACTORS: impact only materializes for applications that actually rely on IP-based rate limiting as a security control (e.g., brute-force or abuse prevention); applications not using RateLimitMiddleware, or those already deploying a trusted-proxy middleware such as uvicorn's ProxyHeaderMiddleware or hypercorn's ProxyFixMiddleware, are unaffected. Only version 2.17.0 is listed as vulnerable, and upgrading to 2.18.0 (which switches the default to client-address-only via get_remote_address) remediates it. |
| Impact | Signals diverge in a way worth stating plainly. The CVSS 3.1 base score of 7.5 is driven entirely by NVD's A:H rating combined with AV:N/AC:L/PR:N/UI:N - trivially triggerable, remote, unauthenticated. However, EPSS is low (0.48%, 40th percentile) and the CVE is NOT in CISA KEV, so there is no evidence of active or widespread exploitation. A working proof-of-concept (curl reproduction steps) IS published in the GHSA advisory, so the capability is public. The NVD A:H rating is debatable: the direct technical impact of CVE-2025-59152 is defeat of a security control (CWE-807, reliance on untrusted X-Forwarded-For in a security decision), not a direct service crash - real impact is indirect (brute-force/credential-stuffing against auth endpoints, unthrottled API abuse, resource exhaustion). No SSVC decision data was provided in the input, so automatable/technical-impact framework scoring cannot be cross-referenced. Net assessment: this is a real but moderate-priority issue - exploitation is effortless and a PoC exists, but impact is conditional on the application actually relying on Litestar's IP-based rate limiting as a protective control, only version 2.17.0 is flagged as vulnerable, and remediation is a simple upgrade. The combination of high CVSS, low EPSS, and no KEV listing points to a theoretically-serious-but-not-currently-targeted flaw. |
| Exploit ScenarioDerived | An attacker targets a login or public API endpoint on a Litestar 2.17.0 application protected by RateLimitMiddleware with default settings. By rotating the X-Forwarded-For header to a new arbitrary value on each request, every attempt is assigned to a fresh rate-limit bucket, so the throttle never triggers and the attacker can run unlimited credential-stuffing or scraping. A minimal working reproduction using curl is published in the GHSA-hm36-ffrh-c77c advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Rate limiting in Litestar 2.17.0 can be completely bypassed by any remote unauthenticated client that rotates the value of the X-Forwarded-For (or X-Real-IP) header on each request, because RateLimitMiddleware derives its per-client cache key from those client-supplied headers by default. The practical consequence is that IP-based throttling used for brute-force, credential-stuffing and scraping protection degrades from an enforced control to an advisory one - but only for applications that actually rely on the middleware as a security boundary and that do not already deploy a trusted-proxy fixer in front of the ASGI app. Exploitation is not known to be occurring (EPSS 0.48%, 40th percentile; not listed in CISA KEV) and no public exploit tooling has been tracked, although the upstream advisory publishes a trivial curl-based reproduction; the gap between NVD's 7.5 (A:H) and this assessment's 5.3 (A:L) reflects that the realistic outcome is loss of a defence-in-depth control rather than a direct service outage.
RemediationAI
Upgrade to Litestar 2.18.0, which is the vendor-released patch: it replaces the header-derived identifier with get_remote_address() (client address only) as the default and adds an optional identifier_for_request callable on RateLimitConfig for custom keys - see advisory https://github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c and commit https://github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb. If the upgrade cannot be performed immediately, patch or subclass RateLimitMiddleware in 2.17.0 so that cache_key_from_request() uses only request.client.host (ignoring X-Forwarded-For and X-Real-IP); the trade-off is that any deployment genuinely behind a reverse proxy will then bucket every user under the proxy's address, causing over-blocking of legitimate clients until proxy-header handling is fixed. Because Litestar's own fix deliberately does not implement proxy trust, applications behind a load balancer must also enable uvicorn's ProxyHeaderMiddleware or hypercorn's ProxyFixMiddleware with an explicit trusted-proxy list, and must ensure the edge strips or overwrites client-supplied X-Forwarded-For headers - otherwise the same spoofing primitive reappears one layer up. For defence in depth, add an independent quota at the ingress (nginx limit_req, cloud WAF or API-gateway rate limiting) that keys on the connection source rather than on a header, and treat the framework middleware as a secondary control; note that duplicating limits on both layers can reject legitimate bursty clients sooner than expected, so tune the two thresholds together.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Litestar is a Python ASGI framework. Its RateLimitMiddleware stores hit counters in a cache keyed by a string produced by cache_key_from_request(), which in 2.17.0 read host = request.client.host if request.client else "anonymous" and then identifier = request.headers.get("X-Forwarded-For") or request.headers.get("X-Real-IP") or host - i.e. any header value, even one appended by an untrusted client, silently outranked the transport-level peer address with no allow-list of trusted proxies and no parsing of the left-most hop. Because the middleware only compares a counter against the configured limit within a single key namespace, an attacker who sends a fresh spoofed address per request lands in a fresh bucket every time and never trips the limit. This is a textbook CWE-807 (Reliance on Untrusted Inputs in a Security Decision) case: attacker-controlled data is used as the identity on which an authorization-like decision (allow vs. 429) is made. The upstream fix (commit 42a89e043e50b515f8548a93954fe143f63cf9fb) adds a get_remote_address() helper that returns only request.client.host, exposes an identifier_for_request callable on RateLimitConfig defaulting to that helper, and documents that proxy headers must be normalised by dedicated middleware (uvicorn ProxyHeaderMiddleware, hypercorn ProxyFixMiddleware) rather than trusted implicitly.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Remote, trivial header spoofing with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is defeat of a rate-limit control enabling abuse/exhaustion, so A:L not A:H, with no direct C/I loss.
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
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.
Executive ViewAI
Litestar 2.17.0's rate-limiting middleware can be bypassed by rotating client-supplied X-Forwarded-For or X-Real-IP headers, weakening IP-based throttling that many teams rely on to slow brute-force, credential-stuffing and scraping. Leadership should care because applications that treat this middleware as a security boundary-especially authentication and public data endpoints-lose an enforced control and face higher exposure to automated abuse, even though the issue is a defence-in-depth gap rather than direct compromise. No active exploitation is confirmed (not in CISA KEV), but the upstream advisory includes a trivial curl-based reproduction, so publicly available exploit code exists.
No vendor-released patch identified; enforce rate limiting at a trusted reverse proxy or WAF keyed to the connecting IP, strip or normalize client-supplied X-Forwarded-For/X-Real-IP at the edge, deploy a trusted-proxy ASGI middleware, and alert on rotating forwarding headers.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
NVD
CVE.org
EPSS
GitHub
Exploit-DB