PHP Code Injection Vulnerability in sqlparse Package

sqlparse Updated 20 Oct 2026

Summary

19/10/2026
N/A
No i
Unrated
Not published

DEBIAN-CVE-2026-112307: 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. Affects sqlparse versions 0.4.2-1 – 0.5.5-2. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The sqlparse package is a lightweight SQL parser for Python that is widely used in various applications for parsing SQL statements. It provides functionalities to analyze and manipulate SQL queries, making it a valuable tool for developers. However, the package is vulnerable to a PHP code injection issue that can be exploited if SQL text containing unescaped dollar signs is supplied.

Vulnerability Detail

sqlparse through version 0.6.0 contains a PHP code injection vulnerability that allows attackers to inject PHP expressions by supplying SQL text with unescaped dollar signs. This vulnerability arises from the way OutputPHPFilter processes SQL strings, enabling attackers to embed sequences like ${expr} or {${expr}}. When the generated snippet runs, it executes arbitrary PHP code, potentially compromising the application and its data.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using unescaped dollar signs in SQL text supplied to the sqlparse package. Review and sanitize any SQL inputs to prevent the injection of malicious PHP expressions.

Conclusion

The sqlparse package is vulnerable to a PHP code injection issue that can lead to severe security risks if not addressed. It is crucial to update to a patched version and implement input validation to protect your applications from potential exploitation.

See every vulnerability recorded for sqlparse →

Share this vulnerability

FAQ

sqlparse is a Python library that provides a non-validating SQL parser for parsing SQL statements. It is commonly used in applications that require SQL query analysis.

If your application uses sqlparse and processes untrusted SQL input, an attacker could exploit this vulnerability to execute arbitrary PHP code, leading to data breaches or application compromise.

Yes, a patch is available in versions of sqlparse higher than 0.6.0. It is recommended to update to the latest version to mitigate the risk.

If immediate updates are not possible, implement input validation and sanitization to prevent unescaped dollar signs in SQL text as a temporary workaround.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By using the Vulert playground, you can check if your application is affected without requiring any installation.

Related vulnerabilities

Recent vulnerabilities recorded for sqlparse.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback