CVE-2026-112307: sqlparse PHP code injection in OutputPHPFilter

CVE-2026-112307 · Severity: high · CVSS 7.3 · Published 2026-10-19

sqlparse is a Python SQL parser library used by applications to process and format SQL queries. The OutputPHPFilter component, which generates PHP code snippets from SQL queries, fails to properly escape dollar signs in SQL input, allowing attackers to inject arbitrary PHP code by embedding expressions like ${...} in SQL text that gets executed when the generated PHP snippet runs.

Vendors: Sqlparse.

Quick answers

Is CVE-2026-112307 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-112307 being exploited in the wild.
How severe is CVE-2026-112307?
High severity, with a CVSS score of 7.3, published 19 October 2026.
Which products and versions are affected?
Sqlparse through 0.6.0.
Is there a fix for CVE-2026-112307?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-112307 attacked?
It is attacked over the network.
Am I affected by CVE-2026-112307?
Check whether you run Sqlparse at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The OutputPHPFilter class in sqlparse's output.py constructs double-quoted PHP strings from SQL tokens without escaping dollar signs, enabling PHP variable interpolation attacks. An attacker supplies malicious SQL containing ${expr} or {${expr}} sequences that the filter places directly into the generated output string, leading to arbitrary PHP code execution. The vulnerable code path does not validate or escape these syntactic elements before output generation.

Affected products

  • sqlparse sqlparse through 0.6.0

Timeline

  • 2026-10-19: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.