CVE-2026-59894
published medium CVSS 4.0 · 6.2sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| andialbrecht | — | sqlparse< 0.6.0 | Affected | Not stated | GitHub_M |
| SUSE / openSUSE | SLE-15-SP4 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP4 | python311-sqlparsenoarch | Advisory build | 0.4.4-150400.6.16.1 | SUSE-SU-2026:3910-1 |
| SUSE / openSUSE | SLE-15-SP5 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP5 | python311-sqlparsenoarch | Advisory build | 0.4.4-150400.6.16.1 | SUSE-SU-2026:3910-1 |
| SUSE / openSUSE | SLE-15-SP6 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP6 | python311-sqlparsenoarch | Advisory build | 0.4.4-150600.3.9.1 | SUSE-SU-2026:3907-1 |
| SUSE / openSUSE | SLE-15-SP7 | python2-sqlparsenoarch | Advisory build | 0.2.4-150100.6.11.1 | SUSE-SU-2026:3762-1 |
Show 13 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | SLE-15-SP7 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP7 | python311-sqlparsenoarch | Advisory build | 0.4.4-150600.3.9.1 | SUSE-SU-2026:3907-1 |
| SUSE / openSUSE | SLE-16 | python313-sqlparsenoarch | Advisory build | 0.5.3-160000.4.1 | SUSE-SU-2026:23561-1 |
| SUSE / openSUSE | SLE-3-SP7 | python311-sqlparsenoarch | Advisory build | 0.4.4-150600.3.9.1 | SUSE-SU-2026:3907-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | python313-sqlparsenoarch | Advisory build | 0.5.3-160000.4.1 | OPENSUSE-SU-2026:21690-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparseaarch64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparseppc64le | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparses390x | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparsex86_64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparseaarch64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparseppc64le | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparses390x | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparsex86_64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 6.2 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- 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
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| andialbrecht | sqlparse | < 0.6.0 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-94 CWE-94: Improper Control of Generation of Code ('Code Injection')
References
1Provider assertions
2GitHub_M · cna
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 3e2ef5b45468bb98f457f75e1c09078d66c7c437524cf33d93e7bfc01350b04f
- Ingested
- 23 Sep 2026, 09:22:51 UTC
- Source record
- Official CVE record