CVE-2025-59152

7.5

Litestar · Litestar

Litestar version 2.17.0 contains a flaw in the RateLimitMiddleware that allows unauthenticated attackers to bypass IP-based rate limiting by spoofing the X-Forwarded-For header.

Executive summary

A critical vulnerability in the Litestar framework allows unauthenticated attackers to bypass rate limiting protections, potentially enabling denial of service or brute force attacks.

Vulnerability

The RateLimitMiddleware relies on untrusted user input from the X-Forwarded-For header to generate cache keys for rate limiting. Unauthenticated attackers can manipulate this header to rotate spoofed IP addresses, effectively rendering the rate limiting mechanism useless.

Business impact

The ability to bypass rate limits poses a significant risk to service availability and security. By circumventing these controls, attackers can perform high-volume automated requests, which may lead to denial of service, resource exhaustion, or successful brute-force attacks against authentication endpoints. Given the CVSS score of 7.5, this high-severity flaw requires immediate attention to protect the integrity and uptime of applications relying on this middleware.

Remediation

Immediate Action: Update the Litestar package to version 2.18.0 or later, which includes the necessary security patch to properly handle X-Forwarded-For headers.

Proactive Monitoring: Review application access logs for patterns of high-frequency requests originating from unusual or rapidly rotating IP addresses that appear to bypass existing rate limits.

Compensating Controls: Implement strict validation of the X-Forwarded-For header at the reverse proxy or load balancer level to ensure only trusted upstream IP addresses are allowed to influence the request identity.

Exploitation status

Public Exploit Available: Unknown.

Analyst recommendation

The vulnerability in Litestar represents a significant degradation of security controls for any application utilizing default rate limiting. Given the ease of exploitation and the potential for service disruption, administrators should prioritize updating to version 2.18.0 immediately. Failure to patch may expose backend services to sustained automated attacks that are otherwise mitigated by rate limiting.

More Litestar CVEs

Sources