CVE-2025-59152
Python vulnerability analysis and mitigation

Overview

CVE-2025-59152 affects Litestar, an Asynchronous Server Gateway Interface (ASGI) framework. The vulnerability was discovered in version 2.17.0 and disclosed on October 5, 2025. The issue allows attackers to completely bypass rate limits by manipulating the X-Forwarded-For header, rendering IP-based rate limiting ineffective (GitHub Advisory).

Technical details

The vulnerability exists in Litestar's RateLimitMiddleware, which uses cachekeyfrom_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. The vulnerability has been assigned a CVSS v3.1 base score of 5.3 (Moderate) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (GitHub Advisory).

Impact

The vulnerability has several significant impacts: it enables brute force protection bypass on authentication endpoints, making them vulnerable to credential stuffing attacks; allows API abuse by circumventing rate limiting protections; and enables resource exhaustion through unrestricted server requests. This is particularly problematic for applications deployed directly without a proxy during development or in containerized environments (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in Litestar version 2.18.0. For immediate mitigation, applications can be deployed behind a properly configured reverse proxy that strips or overwrites client-controllable headers before they reach Litestar. The fix involves not trusting proxy headers unless explicitly configured and implementing proper validation of forwarded IP formats (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-61784HIGH7.6
  • PythonPython
  • llamafactory
NoNoOct 07, 2025
CVE-2025-6985HIGH7.5
  • PythonPython
  • langchain-text-splitters
NoYesOct 06, 2025
CVE-2025-59152HIGH7.5
  • PythonPython
  • litestar
NoYesOct 06, 2025
CVE-2025-61765MEDIUM6.4
  • PythonPython
  • python-socketio
NoYesOct 06, 2025
CVE-2025-61672MEDIUM5.3
  • PythonPython
  • matrix-synapse
NoYesOct 08, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management