{"answers":{"affected":"3 open source packages ship an affected version, including sqlparse.","exploited":"There is no known exploitation of CVE-2026-59894 in the wild and no public exploit code.","fix":"Upgrade sqlparse to 0.6.0 or later.","what":"CVE-2026-59894 is a medium-severity code injection vulnerability in andialbrecht sqlparse, published on 17 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2026-59894 and fix it if it is affected.\n\nWhat it is: CVE-2026-59894 is a medium-severity code injection vulnerability in andialbrecht sqlparse, published on 17 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2026-59894 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- sqlparse (PyPI): affected all versions; fixed in 0.6.0\n- sqlparse (PyPI): affected all versions; fixed in 0.6.0\n- sqlparse (PyPI): affected all versions; fixed in 0.6.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-2026-59894/ (Markdown: https://insights.sbomify.com/CVE-2026-59894/index.md)","id":"CVE-2026-59894","markdown":"https://insights.sbomify.com/CVE-2026-59894/index.md","name":"CVE-2026-59894","record":{"aliases":["CLEANSTART-2026-EP84615","CLEANSTART-2026-VX89697","CLEANSTART-2026-ZF06742","DEBIAN-CVE-2026-59894","ECHO-29a6-7992-df6d","GHSA-3496-9g83-7v6x","MINI-5c4g-gh5v-58g5","MINI-j5r4-r78j-q23w","MINI-r95r-wjrx-w9v8","MINI-rjg2-j7px-9868","MINI-xqxg-p72v-m9h8","PYSEC-2026-3696","UBUNTU-CVE-2026-59894"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Python SQL parser","requires_auth":"none","summary":"Attackers can inject Python or PHP code via crafted SQL when using specific output formats in the sqlparse library.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":6.2,"severity":"medium","source":"cna","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L","version":"4.0"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"description":"sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes","id":"CVE-2026-59894","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2026"},"n_packages":3,"n_references":1,"next":{"headline":"Hono: Server-Side XSS via JSX Escaping Bypass in cx() Utility","id":"CVE-2026-59895"},"packages":[{"ecosystem":"PyPI","fixed":["0.6.0"],"introduced":["0"],"last_affected":[],"package":"sqlparse","purl":null,"source":"GHSA-3496-9g83-7v6x"},{"ecosystem":"PyPI","fixed":["0.6.0"],"introduced":["0"],"last_affected":[],"package":"sqlparse","purl":"pkg:pypi/sqlparse","source":"GHSA-3496-9g83-7v6x"},{"ecosystem":"PyPI","fixed":["0.6.0"],"introduced":["0"],"last_affected":[],"package":"sqlparse","purl":"pkg:pypi/sqlparse","source":"PYSEC-2026-3696"}],"prev":{"headline":"sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)","id":"CVE-2026-59893"},"products":["sqlparse"],"published":"2026-08-17","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":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-08-17","vendors":["andialbrecht"]},"summary":"Attackers can inject Python or PHP code via crafted SQL when using specific output formats in the sqlparse library.","url":"https://insights.sbomify.com/CVE-2026-59894/"}