Read the docs

PHP code injection in sqlparse via output_format='php'

Priority LOW 37CWE-94Published · Updated

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

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00142 3rd percentileScored 2026-11-07
Fix No fix listed No fixed version in the sources yet

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

VendorProductAffected versionsFixed inStatusSource
andialbrechtsqlparseup to 0.6.0—No fix listedCNA
  • 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 →

ProductStatusPlan or fix
Red Hat Ansible Automation Platform 2AffectedNo fix yet
Red Hat OpenShift AI (RHOAI)AffectedNo fix yet
Red Hat Satellite 6AffectedNo 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

  1. 2026-10-19 Threatist record created from CVE-2026-112307
  2. 2026-10-20 Alias added: GHSA-457h-p88w-wq8p
  3. 2026-10-20 Affected versions changed · Red Hat
  4. 2026-10-20 CVSS score added · Red Hat
  5. 2026-10-21 Affected versions changed · Red Hat
  6. 2026-10-23 Affected versions changed · Red Hat
  7. 2026-10-26 Affected versions changed · Red Hat
  8. 2026-10-30 Affected versions changed · Red Hat

References

  • 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