CVE-2025-59152 Details
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.
A vulnerability in Litestar's RateLimitMiddleware in version 2.17.0 allows attackers to completely bypass IP-based rate limits by manipulating the X-Forwarded-For header. The middleware trusts this header unconditionally, using its value to generate cache keys for rate limiting. This flaw enables attackers to create separate rate limit buckets for each spoofed IP, effectively evading restrictions. The issue affects any Litestar application using the default rate limiting settings, which is common. The vulnerability has been patched in version 2.18.0.
Users can update to Litestar version 2.18.0, which addresses this vulnerability by adding validation for X-Forwarded-For headers and allowing the configuration of trusted proxies. For applications that cannot be immediately updated, consider deploying behind a reverse proxy that properly manages client-controllable headers.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 6, 2025CISA-ADP
Assessed Oct 6, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-807 | Reliance on Untrusted Inputs in a Security Decision | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| litestar | 2.17.0 (semver) |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 6, 2025 | New CVE Received | [email protected] |
Volerion