{"id":"CVE-2025-59152","published":"2025-10-06T15:23:12Z","modified":"2025-10-06T15:35:41Z","title":"X-Forwarded-For Header Spoofing Bypasses Litestar Rate Limiting","vendor":"litestar-org","product":"litestar","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00485,"percentile":0.42674,"provenance":"source"},"cwes":[{"id":"CWE-807","name":"Reliance on Untrusted Inputs in a Security Decision"}],"references":[{"url":"https://github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb","tags":["x_refsource_MISC"]},{"url":"https://github.com/litestar-org/litestar/blob/26f20ac6c52de2b4bf81161f7560c8bb4af6f382/litestar/middleware/rate_limit.py#L127","tags":["x_refsource_MISC"]}],"priority":{"score":13.8,"factors":[{"name":"EPSS percentile","points":8.53},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"litestar-org","affectedVersions":[{"vendor":"litestar-org","product":"litestar","versions":["= 2.17.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-10-06T15:35:23.714330Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"litestar","vulnerableRanges":[">=2.17.0, <2.18.0"],"patched":["2.18.0"],"from":["GHSA-hm36-ffrh-c77c","PYSEC-2026-1553"],"provenance":"source"}],"summary":{"text":"A flaw in the RateLimitMiddleware component of Litestar, an ASGI web framework from litestar-org, causes the rate limiter to trust the client-supplied X-Forwarded-For header when building its client identifier in version 2.17.0. An unauthenticated remote attacker who can send HTTP requests to an application using this middleware with default settings can rotate spoofed X-Forwarded-For values to create a separate rate limit bucket for each one, bypassing IP-based rate limiting entirely.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:39:01Z"},"euvd":{"id":"EUVD-2025-32146","exploited":false,"provenance":"source"}}