Skip to content
OpenAdvisories
Medium · 6.2 CVE-2026-59894 EUVD-2026-60308GHSA-3496-9g83-7v6xPYSEC-2026-3696

sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes

Published Aug 17, 2026 · Updated Aug 17, 2026 · Assigned by GitHub_M

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.

Affected products

VendorProductAffectedFixed
andialbrecht sqlparse < 0.6.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 sqlparse No fix yet —
Debian 13 sqlparse No fix yet —
Debian 12 sqlparse No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 sqlparse No fix yet —
Ubuntu 26.04 LTS sqlparse No fix yet —
Ubuntu 24.04 LTS sqlparse No fix yet —
Ubuntu 22.04 LTS sqlparse No fix yet —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 20.04 LTS sqlparse No fix yet —
Ubuntu Pro 18.04 LTS sqlparse No fix yet —
Ubuntu Pro 16.04 LTS sqlparse No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP7 python-sqlparse 0.2.4-150100.6.11.1 SUSE-SU-2026:3762-1
SLES 15 SP7 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES 15 SP6 python-sqlparse 0.4.4-150600.3.9.1 SUSE-SU-2026:3907-1
SLES 15 SP6 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES 15 SP5 python-sqlparse 0.4.4-150400.6.16.1 SUSE-SU-2026:3910-1
SLES 15 SP5 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES 15 SP4 python-sqlparse 0.4.4-150400.6.16.1 SUSE-SU-2026:3910-1
SLES 15 SP4 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES 3 python-sqlparse 0.4.4-150600.3.9.1 SUSE-SU-2026:3907-1
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 python-sqlparse 0.5.3-160000.4.1 SUSE-SU-2026:23561-1
SLES for SAP 15 SP6 python-sqlparse 0.4.4-150600.3.9.1 SUSE-SU-2026:3907-1
SLES for SAP 15 SP6 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES for SAP 15 SP5 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES for SAP 15 SP4 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLES 16.0 python-sqlparse 0.5.3-160000.4.1 SUSE-SU-2026:23561-1
SLE HPC 15 SP5 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
SLE HPC 15 SP4 python3-sqlparse 0.4.2-150300.23.1 SUSE-SU-2026:3906-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-sqlparse 0.6.0-1.1 openSUSE-SU-2026:11557-1
openSUSE Leap 16.0 python-sqlparse 0.5.3-160000.4.1 openSUSE-SU-2026:21690-1

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling airflow-3 3.3.1-r3 —
Wolfi rolling mycli 2.16.0-r1 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI sqlparse < 0.6.0 0.6.0 GHSA-3496-9g83-7v6x

Advisories 7

References