Cloudanix VulnDB

CVE-2026-59894

None

CVSS

—

EPSS

0.1%

Published

Aug 17, 2026

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A tool that turns database queries into program code can be tricked into adding hidden instructions that run on your computer if you do not update it.

Chainable
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Moderate
Impact
Other
Component
Library
Class
Improper Input Validation
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

Unescaped backslashes preceding quotes in sqlparse.format output for python and php modes allow crafted SQL to terminate generated strings and inject executable code into downstream Python or PHP consumers.

Why it matters to the business

Applications that format SQL and later execute or import the output risk arbitrary code execution; low EPSS and absence from KEV indicate limited observed exploitation 70 days after publication, reducing immediate operational urgency.

How an attack unfolds

An attacker supplies specially crafted SQL containing a backslash before a quote to sqlparse.format with output_format set to python or php; the resulting source code terminates the string literal early and appends attacker-controlled statements that execute when the generated file is imported or run.

How to fix it

Upgrade sqlparse to version 0.6.0 or later; avoid using the affected output_format modes until patched; review any code that executes or imports sqlparse-generated source.

How to confirm the fix worked

Confirm sqlparse version is at least 0.6.0; test format calls with known malicious SQL inputs to verify no code injection occurs; scan dependency manifests for older versions.

Typical attack path

  1. Identify application code paths that invoke sqlparse.format with python or php output modes
  2. Craft SQL input containing a backslash immediately before a quote character
  3. Pass the input through sqlparse.format to produce injectable source
  4. Cause the downstream consumer to execute or import the generated code

How to detect it

Search application logs for sqlparse.format calls with python or php output modes; inspect generated source files for unexpected string terminations or injected statements; review dependency trees for pre-0.6.0 versions.

What your security team should do

  • Upgrade all instances of sqlparse to 0.6.0 or newer within 30 days
  • Audit codebases for use of sqlparse.format with python or php output modes
  • Disable or replace affected formatting modes where feasible
  • Monitor EPSS trend for any increase indicating rising exploit availability

The record

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.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities