Arbitrary Code Injection Affecting sqlparse package, versions [,0.6.0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.13% (3rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-SQLPARSE-18905644
  • published18 Aug 2026
  • disclosed17 Aug 2026
  • credit七号公园

Introduced: 17 Aug 2026

NewCVE-2026-59894  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade sqlparse to version 0.6.0 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Injection in the _process method of sqlparse/filters/output.py when generating output via the Python and PHP output formatters. The formatters previously only escaped quote characters (' or ") but did not first escape backslashes, meaning an attacker who controls SQL input containing a backslash immediately preceding a quote character (e.g., \') can cause the backslash to neutralize the intended escape, breaking out of the generated string literal in the downstream output. This allows injection of arbitrary content into the formatter's output.

CVSS Base Scores

version 4.0
version 3.1