{"answers":{"affected":"2 open source packages ship an affected version, including litestar.","exploited":"There is no known exploitation of GHSA-674p-xv2x-rf3g in the wild and no public exploit code.","fix":"Upgrade litestar to 2.17.0 or later.","what":"GHSA-674p-xv2x-rf3g is a vulnerability in litestar, published on 11 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-674p-xv2x-rf3g and fix it if it is affected.\n\nWhat it is: GHSA-674p-xv2x-rf3g is a vulnerability in litestar, published on 11 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-674p-xv2x-rf3g in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- litestar (PyPI): affected all versions; fixed in 2.17.0\n- litestar (PyPI): affected all versions; fixed in 2.17.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/GHSA-674p-xv2x-rf3g/ (Markdown: https://insights.sbomify.com/GHSA-674p-xv2x-rf3g/index.md)","id":"GHSA-674p-xv2x-rf3g","markdown":"https://insights.sbomify.com/GHSA-674p-xv2x-rf3g/index.md","name":"GHSA-674p-xv2x-rf3g","record":{"aliases":[],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["data_modify"],"network_reachable":"yes","non_default_config":true,"product_category":"Python web framework","requires_auth":"none","summary":"Attackers can inject newlines into logs via URL paths in Litestar when exception logging is enabled, allowing log forging.","user_interaction":"not_required","vuln_class":"other"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\n\nLitestar does not escape url paths when logging exceptions. This makes logger vulnerable to CRLF injection if logging level is configured to debug or `log_exceptions` is set to \"always\", which allows attackers to inject newlines and forge log entries.\n\n### Details\n\nLitestar directly formats unquoted path into exception logs without validation or escaping when using default exception logging handler.\n\nhttps://github.com/litestar-org/litestar/blob/1e0dc7c4d67151c836208a3e360051e983b5083a/litestar/logging/config.py#L145-L150\n\nAttackers can inject newlines in logs by embedding`%0d%0a` in url path.\n\n`log_exceptions=\"always\"` is not enabled by default. However, it is set in the examples of documentation (https://github.com/litestar-org/litestar/blob/1e0dc7c4d67151c836208a3e360051e983b5083a/docs/usage/logging.rst#logging). User will be impacted if they directly copy the logging config from docs.\n\n### PoC\n\n```\ncurl \"http://172.17.0.2:8000/%29%0D%0AINFO:%20%20%20%20%20127.0.0.1:8192%20-%20%22POST%20/login%20HTTP/1.1%22%20200%20OK%0D%0A%28\"\n```\n\nlogging:\n\n```\n2025-07-15 00:00:00 - litestar - ERROR - Uncaught exception (connection_type=http, path=/)\nINFO:     127.0.0.1:8192 - \"POST /login HTTP/1.1\" 200 OK\n...\n```\n\nIf stacktracks for 404 are configured to be ignored (`disable_stack_trace={404},`), attacker may also exploit this by sending malformed requests to cause 400/500 exceptions and avoid 404 in endpoints with str path parameters.","ecosystems":["PyPI"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Litestar has potential log injection in exception logging","id":"GHSA-674p-xv2x-rf3g","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"other","year":"2025"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"PyPI","fixed":["2.17.0"],"introduced":["0"],"last_affected":[],"package":"litestar","purl":null,"source":"GHSA-674p-xv2x-rf3g"},{"ecosystem":"PyPI","fixed":["2.17.0"],"introduced":["0"],"last_affected":[],"package":"litestar","purl":"pkg:pypi/litestar","source":"GHSA-674p-xv2x-rf3g"}],"products":null,"published":"2025-08-11","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can inject newlines into logs via URL paths in Litestar when exception logging is enabled, allowing log forging.","url":"https://insights.sbomify.com/GHSA-674p-xv2x-rf3g/"}