PHP code injection in sqlparse via output_format='php'
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- No fix listed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-94.
Summary
sqlparse through 0.6.0 contains a PHP code injection flaw in its PHP output format. Unescaped dollar signs in SQL text let an attacker inject PHP expressions that run when the generated snippet executes (CWE-94). A local attacker with no privileges can exploit it, but a user must take action for the injected code to run.
Written with Claude Haiku 5.5 from the sources below · 2026-10-30
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| andialbrecht | sqlparse | up to 0.6.0 | — | No fix listed | CNA |
- sqlparse Vendorandialbrecht Affected up to 0.6.0 Fixed in — No fix listed CNA
Remediation
The sources list no fixed version for sqlparse. Red Hat lists Red Hat Ansible Automation Platform 2, Red Hat OpenShift AI (RHOAI) and Red Hat Satellite 6 as affected without a fix, with no plan available.
Written with Claude Haiku 5.5 from the sources below · 2026-10-30
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet |
| Red Hat Satellite 6 | Affected | No fix yet |
Not affected: 9 products
- Red Hat Ansible Automation Platform 2
- Red Hat Discovery 2
- Red Hat OpenShift AI (RHOAI)
- Red Hat OpenShift Container Platform 4
- Red Hat OpenStack Platform 13 (Queens)
- Red Hat OpenStack Platform 16.2
- Red Hat OpenStack Platform 17.1
- Red Hat OpenStack Platform 18.0
- Red Hat Update Infrastructure 4 for Cloud Providers
Timeline
- 2026-10-19 Threatist record created from CVE-2026-112307
- 2026-10-20 Alias added: GHSA-457h-p88w-wq8p
- 2026-10-20 Affected versions changed · Red Hat
- 2026-10-20 CVSS score added · Red Hat
- 2026-10-21 Affected versions changed · Red Hat
- 2026-10-23 Affected versions changed · Red Hat
- 2026-10-26 Affected versions changed · Red Hat
- 2026-10-30 Affected versions changed · Red Hat
References
More andialbrecht vulnerabilities
- TI-2026-39184 sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger CVSS 4.0HIGH 8.7
- TI-2026-42707 sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service) CVSS 3.1HIGH 7.5
- TI-2026-57940 sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption CVSS 4.0MEDIUM 5.1
- TI-2026-50099 sqlparse: Quadratic O(n²) DoS in group_comments CVSS 4.0HIGH 8.7
- TI-2026-42708 sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes CVSS 4.0MEDIUM 6.2
Sources
- CVE-2026-112307 · CVE Program
- CVE-2026-112307 · NVD
- FIRST EPSS
- GHSA-457h-p88w-wq8p · GitHub Advisory Database · CC BY 4.0
- CVE-2026-112307 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences