Description
sqlparse through 0.6.0 contains a PHP code injection vulnerability that allows attackers to inject PHP expressions by supplying SQL text containing unescaped dollar signs. Attackers can embed ${expr} or {${expr}} sequences that OutputPHPFilter places in double-quoted strings, executing arbitrary PHP code when the generated snippet runs.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | sqlparse | No fix yet | — |
| Debian 13 | sqlparse | No fix yet | — |
| Debian 12 | sqlparse | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP7 | python-sqlparse | 0.2.4-150100.6.17.1 | SUSE-SU-2026:5042-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-sqlparse | 0.6.0-2.1 | openSUSE-SU-2026:12382-1 |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | py3-sqlparse +5 | 0.6.1-r0 | — |
Advisories 2
- SUSE-SU-2026:5042-1 Security update for python-sqlparse SUSE / openSUSE Security Updates · Nov 3, 2026
- openSUSE-SU-2026:12382-1 python313-sqlparse-0.6.0-2.1 on GA media SUSE / openSUSE Security Updates · Nov 2, 2026
References
- https://github.com/andialbrecht/sqlparse/pull/930 patch issue-tracking
- https://github.com/andialbrecht/sqlparse/blob/0.6.0/sqlparse/filters/output.py technical-description
- VulnCheck Advisory: sqlparse through 0.6.0 PHP Code Injection via output_format='php' third-party-advisory