IT SBIT Services
Schneeberger
DEEN
CVE tracker

sqlparse: PHP code injection via unescaped dollar signs in PHP output format

CVE-2026-112307High 8.4

← All vulnerabilities

Summary

sqlparse, a Python SQL parsing library, contains a code injection flaw in its PHP output format (output_format='php'). Unescaped dollar signs in SQL text are placed into double-quoted PHP strings, so an attacker can embed ${expr} sequences that execute arbitrary PHP code when the generated snippet runs. Exploitation requires that an application converts untrusted SQL with this output format and executes the result; the CVSS vector assumes local access and user interaction.

Affected

  • sqlparse 0.6.0 and earlier (affected range 0 to <= 0.6.0 per VulnCheck)
  • Only applications that use the PHP output format on untrusted SQL text are exposed

Fixed in

Unknown. No fixed version is confirmed for this CVE. Upgrading to 0.6.0 does not fix it, as 0.6.0 is within the affected range.

Workaround

  • Do not use the PHP output format (output_format='php') for untrusted input
  • Do not execute or import generated PHP or Python snippets from sqlparse
  • Check whether your code or dependencies use these output modes at all

Exploitation

  • No known exploitation in the wild
  • CISA SSVC (VulnCheck): exploitation none, automatable no, technical impact total
  • Not listed in CISA KEV
  • No public proof of concept found during research

Our recommendation

  • Search Python projects and lock files (including transitive dependencies) for sqlparse
  • Check whether any code uses the PHP output format on untrusted input and stop that use
  • Track the GitHub advisory and PR #930 for a confirmed fixed version and upgrade when available
  • Re-check the NVD entry, which is currently listed as Deferred

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 12:18.

Original description (NVD)

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.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.