{"answers":{"affected":"3 open source packages ship an affected version, including litestar.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59152 exists.","fix":"Upgrade litestar to 2.18.0 or later.","what":"CVE-2025-59152 is a high-severity vulnerability in litestar-org litestar, published on 6 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-59152 and fix it if it is affected.\n\nWhat it is: CVE-2025-59152 is a high-severity vulnerability in litestar-org litestar, published on 6 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59152 exists.\n\nAffected packages and fixed versions:\n- litestar (PyPI): affected from 2.17.0; fixed in 2.18.0\n- litestar (PyPI): affected from 2.17.0; fixed in 2.18.0\n- litestar (PyPI): affected from 2.17.0; fixed in 2.18.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-59152/ (Markdown: https://insights.sbomify.com/CVE-2025-59152/index.md)","id":"CVE-2025-59152","markdown":"https://insights.sbomify.com/CVE-2025-59152/index.md","name":"CVE-2025-59152","record":{"aliases":["GHSA-hm36-ffrh-c77c","PYSEC-2026-1553"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Python ASGI framework","requires_auth":"none","summary":"Attackers can bypass IP-based rate limiting in Litestar applications by spoofing the X-Forwarded-For header, allowing unlimited requests.","user_interaction":"not_required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-807","name":"Reliance on Untrusted Inputs in a Security Decision"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"X-Forwarded-For Header Spoofing Bypasses Litestar Rate Limiting","id":"CVE-2025-59152","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"security_feature_bypass","year":"2025"},"n_packages":3,"n_references":3,"next":{"headline":"Openfire allows potential identity spoofing via unsafe CN parsing","id":"CVE-2025-59154"},"packages":[{"ecosystem":"PyPI","fixed":["2.18.0"],"introduced":["2.17.0"],"last_affected":[],"package":"litestar","purl":null,"source":"GHSA-hm36-ffrh-c77c"},{"ecosystem":"PyPI","fixed":["2.18.0"],"introduced":["2.17.0"],"last_affected":[],"package":"litestar","purl":"pkg:pypi/litestar","source":"GHSA-hm36-ffrh-c77c"},{"ecosystem":"PyPI","fixed":["2.18.0"],"introduced":["2.17.0"],"last_affected":[],"package":"litestar","purl":"pkg:pypi/litestar","source":"PYSEC-2026-1553"}],"prev":{"headline":"Pi-hole Admin Interface vulnerable to HTTP response header injection via CRLF injection","id":"CVE-2025-59151"},"products":["litestar"],"published":"2025-10-06","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-10-06","vendors":["litestar-org"]},"summary":"Attackers can bypass IP-based rate limiting in Litestar applications by spoofing the X-Forwarded-For header, allowing unlimited requests.","url":"https://insights.sbomify.com/CVE-2025-59152/"}