CVE-2026-112307: sqlparse through 0.6.0 PHP Code Injection via output_format='php'

Published Oct 19, 2026
·
Updated

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 Software

1 affected component
pypi/sqlparse<=0.6.0

Event History

Oct 19, 2026
CVE Published
via MITRE·03:28 PM
Data Sourced
via MITRE·03:28 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What conditions are required for exploitation?

An attacker must be able to supply SQL text that is processed with output_format='php'. The generated PHP snippet must then be executed for the injected PHP expression to run.

2

Which inputs should be treated as dangerous?

SQL containing unescaped dollar signs can be dangerous, particularly ${expr} or {${expr}} sequences. These sequences can be placed into double-quoted strings by OutputPHPFilter and evaluated when the generated code runs.

3

What can be done if updating is not immediately possible?

Do not use output_format='php' for SQL originating from untrusted sources, and do not execute PHP snippets generated from such input. Reject or safely handle SQL containing the affected dollar-sign expression sequences before it reaches OutputPHPFilter.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203