cve.bz

CVE-2026-112307 andialbrecht sqlparse: Code Injection

8.4 highEPSS 0.1%

High (8.4) in andialbrecht sqlparse. EPSS 0.1% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 4.0

8.4 high
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N

CVSS 3.1

7.3 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
EPSS
0.1% (unchanged from 0.1% a week ago) estimated probability of exploitation activity in the next 30 days; 4th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-10-19. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
Assigned by
VulnCheck (CNA)
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-112307 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-112307?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-112307?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-112307 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
andialbrecht sqlparsethrough 0.6.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14sqlparseno fix listedDEBIAN-CVE-2026-112307
Ubuntu22.04:LTS, 24.04:LTS, 26.04:LTS and 4 moresqlparseno fix listedUBUNTU-CVE-2026-112307
SUSELinux Enterprise Module for Package Hub 15 SP7python-sqlparse0.2.4-150100.6.17.1SUSE-SU-2026:5042-1
openSUSETumbleweedpython-sqlparse0.6.0-2.1openSUSE-SU-2026:12382-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is rated as Important severity because successful exploitation can result in arbitrary code execution with the privileges of the executing application. Within Red Hat environments, sqlparse is primarily utilized by Python-based services for database interactions, query inspection, and internal migrations rather than generating executable PHP scripts. To trigger this flaw, an application must explicitly invoke sqlparse to export untrusted SQL input using the PHP formatting mode and then evaluate or run the resulting output in a PHP interpreter. Consequently, standard deployments of Red Hat products that consume this library do not typically expose this execution vector.

Red Hat's mitigation

--- CME Mitigation Guidance (2026-10-20) ---

Disclaimer: The following mitigation solutions are provided as a courtesy, pending the application of an official patch. This content was generated utilizing AI tools in conjunction with data from https://cmetaxonomy.org. Customers are advised to independently evaluate and test these temporary mitigations within their own infrastructure.

The highest-value action is to sanitize and escape dollar signs when formatting SQL tokens into PHP double-quoted strings in OutputPHPFilter, or avoid executing generated PHP snippets: upgrade to the fixed Python Sqlparse/Ansible Automation Platform 24/Controller Rhel/Ansible Automation Platform 24/Lightspeed Rhel/Automation Controller/Python3X Sqlparse/Cloudservices/Advisor Backend/Advisor Backend/Python3.11 Sqlparse/Python3.12 Sqlparse/Ansible Automation Platform 26/Hub Rhel/Ansible Automation Platform Tech Preview/Metrics Service Rhel/Ansible Automation Platform 27/Aap Cloud Billing Rhel/Ansible Automation Platform 27/Metrics Service Rhel/Cloudservices/Rbac/Rhoai/Odh Mlflow Rhel/Rhoai/Odh Pipeline Runtime Datascience Cpu Py312 Rhel/Rhoai/Odh Pipeline Runtime Pytorch Cuda Py312 Rhel/Rhoai/Odh Pipeline Runtime Pytorch Llmcompressor Cuda Py312 Rhel/Rhoai/Odh Pipeline Runtime Pytorch Rocm Py312 Rhel/Rhoai/Odh Pipeline Runtime Tensorflow Cuda Py312 Rhel/Rhoai/Odh Pipeline Runtime Tensorflow Rocm Py312 Rhel/Rhoai/Odh Th06 Cpu Torch210 Py312 Rhel/Rhoai/Odh Th06 Cuda130 Torch210 Py312 Rhel/Rhoai/Odh Th06 Rocm64 Torch291 Py312 Rhel/Rhoai/Odh Training Cuda128 Torch29 Py312 Rhel/Rhoai/Odh Workbench Codeserver Datascience Cpu Py312 Rhel/Rhoai/Odh Workbench Jupyter Datascience Cpu Py312 Rhel/Rhoai/Odh Workbench Jupyter Pytorch Cuda Py312 Rhel/Rhoai/Odh Workbench Jupyter Pytorch Llmcompressor Cuda Py312 Rhel/Rhoai/Odh Workbench Jupyter Pytorch Rocm Py312 Rhel/Rhoai/Odh Workbench Jupyter Tensorflow Cuda Py312 Rhel/Rhoai/Odh Workbench Jupyter Tensorflow Rocm Py312 Rhel/Rhoai/Odh Workbench Jupyter Trustyai Cpu Py312 Rhel/Rhoai/Odh Th Torch Cpu Py312 Rhel/Rhoai/Odh Th Torch Cuda Py312 Rhel/Rhoai/Odh Th Torch Rocm Py312 Rhel/Ansible Automation Platform/Automation Dashboard Rhel/Ansible Automation Platform 25/Controller Rhel/Ansible Automation Platform 25/Lightspeed Rhel/Ansible Automation Platform 26/Controller Rhel/Ansible Automation Platform 26/Eda Controller Rhel/Ansible Automation Platform 26/Gateway Rhel/Ansible Automation Platform 26/Lightspeed Rhel/Ansible Automation Platform 27/Controller Rhel/Ansible Automation Platform 27/Eda Controller Rhel/Ansible Automation Platform 27/Gateway Rhel/Ansible Automation Platform 27/Hub Rhel/Ansible Automation Platform 27/Lightspeed Rhel/Galaxy Ng/Automation Hub Container/Ansible Ai Connect Service/Koku/Insights Rbac/Google Lightspeed Agent/Discovery/Discovery Server Rhel/Satellite/Iop Advisor Backend Rhel builds, which escape dollar signs as \$ after backslash and quotation mark escaping in OutputPHPFilter, closing all 3 injection vectors (embedded PHP variable interpolation expressions (${expr}), embedded complex PHP expression interpolation sequences ({${expr}})!, crafted SQL containing unescaped dollar signs). Until patched, this is a concern on Applications on any platform passing untrusted SQL to sqlparse with PHP output formatting where the resulting code is executed in PHP, so Disallow untrusted SQL input from being processed with sqlparse PHP output formatting and prevent execution or evaluation of generated PHP snippets in runtime environments. As a compensating measure, Inspect incoming HTTP payloads with a Web Application Firewall to detect and block SQL input containing PHP variable interpolation patterns such as unescaped dollar-sign expressions, Use an Endpoint Detection and Response agent to detect anomalous post-exploitation behavior or child process spawning triggered when the PHP runtime evaluates injected expressions, and Deploy Falco or eBPF runtime security to detect unexpected shells or suspicious system calls spawned by the PHP process executing injected code. These controls limit blast radius and contain exploitation, but they do not fix the underlying unescaped PHP string interpolation defect — apply the upstream patch to fully remediate.

Highest-impact CME: CME-1309 Script Engine Restriction (Sandbox / Disable) (high)

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/controller-rhel8Will not fix
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/lightspeed-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/controller-rhel8Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/lightspeed-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/controller-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/eda-controller-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/gateway-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/hub-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/lightspeed-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/aap-cloud-billing-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/controller-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/eda-controller-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/gateway-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/hub-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/lightspeed-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/metrics-service-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform/automation-dashboard-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-tech-preview/metrics-service-rhel9Affected
Red Hat Ansible Automation Platform 2automation-controllerAffected
Red Hat Ansible Automation Platform 2python3.11-sqlparseNot affected
34 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-112307.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON