CVE-2025-59152
Full vulnerability record from the local CVENow database.
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.
View original CVE JSON
{
"id": "CVE-2025-59152",
"sourceIdentifier": "[email protected]",
"published": "2025-10-06T16:15:34.193",
"lastModified": "2026-10-19T16:10:00.260",
"vulnStatus": "Deferred",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "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."
},
{
"lang": "es",
"value": "Litestar es un framework de Interfaz de Pasarela de Servidor Asíncrono (ASGI). En la versión 2.17.0, los límites de tasa pueden ser completamente eludidos manipulando el encabezado X-Forwarded-For. Esto hace que la limitación de tasa basada en IP sea ineficaz contra atacantes decididos. El RateLimitMiddleware de Litestar utiliza 'cache_key_from_request()' para generar claves de caché para la limitación de tasa. Cuando un encabezado X-Forwarded-For está presente, el middleware lo confía incondicionalmente y utiliza su valor como parte del identificador del cliente. Dado que los clientes pueden establecer valores X-Forwarded-For arbitrarios, cada IP falsificada diferente crea un cubo de límite de tasa separado. Un atacante puede rotar a través de diferentes valores de encabezado para evitar alcanzar el límite de cualquier cubo individual. Esto afecta a cualquier aplicación Litestar que utilice RateLimitMiddleware con la configuración predeterminada, lo que probablemente incluye la mayoría de las aplicaciones que implementan la limitación de tasa. La versión 2.18.0 contiene un parche para la vulnerabilidad."
}
],
"affected": [
{
"source": "[email protected]",
"affectedData": [
{
"vendor": "litestar-org",
"product": "litestar",
"versions": [
{
"version": "= 2.17.0",
"status": "affected"
}
]
}
]
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "[email protected]",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"availabilityImpact": "HIGH"
},
"exploitabilityScore": 3.9,
"impactScore": 3.6
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"timestamp": "2025-10-06T15:35:23.714330Z",
"id": "CVE-2025-59152",
"options": [
{
"exploitation": "poc"
},
{
"automatable": "yes"
},
{
"technicalImpact": "partial"
}
],
"role": "CISA Coordinator",
"version": "2.0.3"
}
}
]
},
"weaknesses": [
{
"source": "[email protected]",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-807"
}
]
}
],
"references": [
{
"url": "https://github.com/litestar-org/litestar/blob/26f20ac6c52de2b4bf81161f7560c8bb4af6f382/litestar/middleware/rate_limit.py#L127",
"source": "[email protected]"
},
{
"url": "https://github.com/litestar-org/litestar/commit/42a89e043e50b515f8548a93954fe143f63cf9fb",
"source": "[email protected]"
},
{
"url": "https://github.com/litestar-org/litestar/security/advisories/GHSA-hm36-ffrh-c77c",
"source": "[email protected]"
}
]
}