# CVE-2025-59152: X-Forwarded-For Header Spoofing Bypasses Litestar Rate Limiting

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.48%, higher than 43% of CVEs (2026-12-01)
- Published: 2025-10-06T15:23:12.526Z
- Modified: 2026-10-19T16:10:00.260Z
- Also known as: GHSA-hm36-ffrh-c77c, PYSEC-2026-1553
- Weaknesses: CWE-807
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- litestar-org litestar: = 2.17.0
- litestar (PyPI): from 2.17.0 before 2.18.0

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c> (web)
- <https://github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb> (web)
- <https://github.com/litestar-org/litestar/blob/26f20ac6c52de2b4bf81161f7560c8bb4af6f382/litestar/middleware/rate_limit.py#L127> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-59152> (advisory)
- <https://github.com/litestar-org/litestar> (package)
- <https://pypi.org/project/litestar> (package)
- <https://github.com/advisories/GHSA-hm36-ffrh-c77c> (advisory)

## Sources

- CVE List: [CVE-2025-59152](https://www.cve.org/CVERecord?id=CVE-2025-59152), CVE Terms of Use, modified 2025-10-06
- GitHub Advisory Database: [GHSA-hm36-ffrh-c77c](https://github.com/advisories/GHSA-hm36-ffrh-c77c), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2025-59152](https://nvd.nist.gov/vuln/detail/CVE-2025-59152), Public domain, modified 2026-10-19
- PyPA Advisory Database: [PYSEC-2026-1553](https://osv.dev/vulnerability/PYSEC-2026-1553), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-59152 · Whole record: https://cve.day/CVE-2025-59152.json · Rebuilt by cve.day 2026-11-25T22:59:05.566Z
