CVE-2026-59894
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.2
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
- Record
CVE-2026-59894- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2026-60308
6.2
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
- Record
EUVD-2026-60308- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-3496-9g83-7v6x
6.2
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
Summary
The documented Python and PHP output modes generate source-code snippets from caller-supplied SQL. Their output filters escape quote characters without first escaping existing backslashes. Crafted SQL can therefore neutralize the generated quote escape, terminate the intended language string, and place attacker-controlled code into the generated snippet. If a downstream consumer executes or imports that generated source, the injected code runs in the consumer's environment.
Details
The Python output filter places SQL in a single-quoted string and replaces each single quote with an escaped quote. The PHP output filter performs the equivalent operation for a double-quoted string. Neither transformation escapes pre-existing backslashes before escaping quotes. A backslash supplied immediately before a quote causes the generated backslash to be escaped instead of the quote, allowing the quote to close the string.
The affected modes are exposed through sqlparse.format(..., output_format='python'), sqlparse.format(..., output_format='php'), and the corresponding sqlformat -l options. Formatting produces the injected source but does not itself execute it; code execution occurs when a downstream workflow treats the generated snippet as Python or PHP code.
Relevant code locations:
sqlparse/formatter.py:193— selection of the output-language filterssqlparse/filters/output.py:45— opening of the generated Python stringsqlparse/filters/output.py:65— incomplete Python quote escapingsqlparse/filters/output.py:91— opening of the generated PHP stringsqlparse/filters/output.py:114— incomplete PHP quote escaping
PoC
A complete validated reproduction is attached as output_format_snippet_injection-poc.zip. The archive contains reproduction/ at its root, uses Git and Docker, and validates the Python output path by generating and executing a snippet containing a controlled marker-file write.
Extract the archive beside this report, then run:
./reproduction/run.sh
Observed result:
The generated Python snippet placed the attacker-controlled pathlib.Path(...).write_text(...) expression outside the intended SQL string. Executing the snippet wrote the expected proof marker, emitted EVOHUNT_OUTPUT_FORMAT_INJECTION_VERIFIED, and completed successfully.
Verification method:
The verification helper calls sqlparse.format(..., output_format='python'), executes the generated snippet, and fails unless the injected Python expression writes the exact proof marker file.
Limitations:
No reproduction blocker was recorded. The attached harness directly verifies the Python output path; exploitation also requires a downstream consumer to execute or import the generated source.
Impact
This is source-code injection in the opt-in Python and PHP snippet-generation modes. An attacker who controls SQL converted by one of these modes can inject language code into the generated artifact. If that artifact is subsequently executed, the attacker can run code with the permissions and access of the downstream Python or PHP process.
The demonstrated end-to-end result is code execution through a generated Python snippet. Formatting the SQL alone does not execute the payload, and ordinary parsing, splitting, or formatting without these output modes is not shown to be affected.
- Record
GHSA-3496-9g83-7v6x- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Weakness
- CWE-94
- Updated
- 2026-11-02
NVD
6.2
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
- Record
CVE-2026-59894- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
6.2
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
- Record
CVE-2026-59894- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-59894
6.2
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
- Record
DEBIAN-CVE-2026-59894- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 14 moreShow less
OSVGHSA-3496-9g83-7v6x
6.2
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
Summary
The documented Python and PHP output modes generate source-code snippets from caller-supplied SQL. Their output filters escape quote characters without first escaping existing backslashes. Crafted SQL can therefore neutralize the generated quote escape, terminate the intended language string, and place attacker-controlled code into the generated snippet. If a downstream consumer executes or imports that generated source, the injected code runs in the consumer's environment.
Details
The Python output filter places SQL in a single-quoted string and replaces each single quote with an escaped quote. The PHP output filter performs the equivalent operation for a double-quoted string. Neither transformation escapes pre-existing backslashes before escaping quotes. A backslash supplied immediately before a quote causes the generated backslash to be escaped instead of the quote, allowing the quote to close the string.
The affected modes are exposed through sqlparse.format(..., output_format='python'), sqlparse.format(..., output_format='php'), and the corresponding sqlformat -l options. Formatting produces the injected source but does not itself execute it; code execution occurs when a downstream workflow treats the generated snippet as Python or PHP code.
Relevant code locations:
sqlparse/formatter.py:193— selection of the output-language filterssqlparse/filters/output.py:45— opening of the generated Python stringsqlparse/filters/output.py:65— incomplete Python quote escapingsqlparse/filters/output.py:91— opening of the generated PHP stringsqlparse/filters/output.py:114— incomplete PHP quote escaping
PoC
A complete validated reproduction is attached as output_format_snippet_injection-poc.zip. The archive contains reproduction/ at its root, uses Git and Docker, and validates the Python output path by generating and executing a snippet containing a controlled marker-file write.
Extract the archive beside this report, then run:
./reproduction/run.sh
Observed result:
The generated Python snippet placed the attacker-controlled pathlib.Path(...).write_text(...) expression outside the intended SQL string. Executing the snippet wrote the expected proof marker, emitted EVOHUNT_OUTPUT_FORMAT_INJECTION_VERIFIED, and completed successfully.
Verification method:
The verification helper calls sqlparse.format(..., output_format='python'), executes the generated snippet, and fails unless the injected Python expression writes the exact proof marker file.
Limitations:
No reproduction blocker was recorded. The attached harness directly verifies the Python output path; exploitation also requires a downstream consumer to execute or import the generated source.
Impact
This is source-code injection in the opt-in Python and PHP snippet-generation modes. An attacker who controls SQL converted by one of these modes can inject language code into the generated artifact. If that artifact is subsequently executed, the attacker can run code with the permissions and access of the downstream Python or PHP process.
The demonstrated end-to-end result is code execution through a generated Python snippet. Formatting the SQL alone does not execute the payload, and ordinary parsing, splitting, or formatting without these output modes is not shown to be affected.
- Record
GHSA-3496-9g83-7v6x- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVOESA-2026-4218
8.7
python-sqlparse security update
A non-validating SQL parser.
Security Fix(es):
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, TokenList construction and string conversion in sqlparse/sql.py repeatedly flatten nested token subtrees constructed by group_parenthesis and group_case, causing quadratic CPU consumption through sqlparse.parse(), sqlparse.format(), and sqlparse.split() before depth and token limits terminate processing. This issue is fixed in version 0.6.0.(CVE-2026-54284)
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.(CVE-2026-59894)
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, group_comments in sqlparse/engine/grouping.py repeatedly rescans comment-only statements before the MAX_GROUPING_TOKENS guard, causing quadratic CPU consumption through sqlparse.parse() and sqlparse.format(sql, strip_comments=True). This issue is fixed in version 0.6.0.(CVE-2026-71491)
- Record
OESA-2026-4218- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
OSVOESA-2026-4219
8.7
python-sqlparse security update
A non-validating SQL parser.
Security Fix(es):
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, TokenList construction and string conversion in sqlparse/sql.py repeatedly flatten nested token subtrees constructed by group_parenthesis and group_case, causing quadratic CPU consumption through sqlparse.parse(), sqlparse.format(), and sqlparse.split() before depth and token limits terminate processing. This issue is fixed in version 0.6.0.(CVE-2026-54284)
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.(CVE-2026-59894)
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, group_comments in sqlparse/engine/grouping.py repeatedly rescans comment-only statements before the MAX_GROUPING_TOKENS guard, causing quadratic CPU consumption through sqlparse.parse() and sqlparse.format(sql, strip_comments=True). This issue is fixed in version 0.6.0.(CVE-2026-71491)
- Record
OESA-2026-4219- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
OSVOESA-2026-4320
6.2
python-sqlparse security update
A non-validating SQL parser.
Security Fix(es):
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.(CVE-2026-59894)
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse.format(sql, reindent=True) and sqlformat --reindent route attacker-controlled parenthesized tuple lists through ReindentFilter._get_offset() in sqlparse/filters/reindent.py, where _flatten_up_to_token() repeatedly rebuilds and joins the statement prefix. Thousands of offset calculations walk an expanding token tree, producing quadratic CPU consumption for inputs that remain below MAX_GROUPING_TOKENS and causing request delays, reduced throughput, or worker starvation. This issue is fixed in version 0.6.0.(CVE-2026-84305)
- Record
OESA-2026-4320- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
OSVPYSEC-2026-3696
6.2
sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
Summary
The documented Python and PHP output modes generate source-code snippets from caller-supplied SQL. Their output filters escape quote characters without first escaping existing backslashes. Crafted SQL can therefore neutralize the generated quote escape, terminate the intended language string, and place attacker-controlled code into the generated snippet. If a downstream consumer executes or imports that generated source, the injected code runs in the consumer's environment.
Details
The Python output filter places SQL in a single-quoted string and replaces each single quote with an escaped quote. The PHP output filter performs the equivalent operation for a double-quoted string. Neither transformation escapes pre-existing backslashes before escaping quotes. A backslash supplied immediately before a quote causes the generated backslash to be escaped instead of the quote, allowing the quote to close the string.
The affected modes are exposed through sqlparse.format(..., output_format='python'), sqlparse.format(..., output_format='php'), and the corresponding sqlformat -l options. Formatting produces the injected source but does not itself execute it; code execution occurs when a downstream workflow treats the generated snippet as Python or PHP code.
Relevant code locations:
sqlparse/formatter.py:193— selection of the output-language filterssqlparse/filters/output.py:45— opening of the generated Python stringsqlparse/filters/output.py:65— incomplete Python quote escapingsqlparse/filters/output.py:91— opening of the generated PHP stringsqlparse/filters/output.py:114— incomplete PHP quote escaping
PoC
A complete validated reproduction is attached as output_format_snippet_injection-poc.zip. The archive contains reproduction/ at its root, uses Git and Docker, and validates the Python output path by generating and executing a snippet containing a controlled marker-file write.
Extract the archive beside this report, then run:
./reproduction/run.sh
Observed result:
The generated Python snippet placed the attacker-controlled pathlib.Path(...).write_text(...) expression outside the intended SQL string. Executing the snippet wrote the expected proof marker, emitted EVOHUNT_OUTPUT_FORMAT_INJECTION_VERIFIED, and completed successfully.
Verification method:
The verification helper calls sqlparse.format(..., output_format='python'), executes the generated snippet, and fails unless the injected Python expression writes the exact proof marker file.
Limitations:
No reproduction blocker was recorded. The attached harness directly verifies the Python output path; exploitation also requires a downstream consumer to execute or import the generated source.
Impact
This is source-code injection in the opt-in Python and PHP snippet-generation modes. An attacker who controls SQL converted by one of these modes can inject language code into the generated artifact. If that artifact is subsequently executed, the attacker can run code with the permissions and access of the downstream Python or PHP process.
The demonstrated end-to-end result is code execution through a generated Python snippet. Formatting the SQL alone does not execute the payload, and ordinary parsing, splitting, or formatting without these output modes is not shown to be affected.
- Record
PYSEC-2026-3696- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Updated
- 2026-11-02
OSVRHLW-2026-7cb565d499929657
7.5
Lightwell Security Advisory: sqlparse 0.5.5+rhlw.1
Red Hat Lightwell has released sqlparse 0.5.5+rhlw.1 with backported fixes for CVE-2026-54284, CVE-2026-59893, CVE-2026-59894, CVE-2026-71491, and CVE-2026-84305.
CVE-2026-54284: sqlparse: TokenList.init materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger
CVE-2026-59893: sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)
CVE-2026-59894: sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
CVE-2026-71491: sqlparse: Quadratic O(n²) DoS in group_comments
CVE-2026-84305: sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption
This patched artifact is a drop-in replacement for sqlparse 0.5.5 from PyPI.
- Record
RHLW-2026-7cb565d499929657- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-06
OSVUBUNTU-CVE-2026-59894
6.2
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.
- Record
UBUNTU-CVE-2026-59894- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L - Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11557-1 No score
python313-sqlparse-0.6.0-1.1 on GA media
These are all security issues fixed in the python313-sqlparse-0.6.0-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11557-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:21690-1 No score
Security update for python-sqlparse
This update for python-sqlparse fixes the following issues:
- CVE-2026-54284: high algorithm complexity when parsing SQL payloads with hundreds of nesting levels can lead to denial of service via excessive resource consumption (bsc#1275459).
- CVE-2026-59893: quadratic complexity when processing unmatched dollar-quoted literal and multiline-comment delimiters can lead to denial of service (bsc#1275461).
- CVE-2026-59894: improper backlash escaping allows for injection of Python or PHP code via a crafted SQL input (bsc#1275460).
- CVE-2026-71491: quadratic complexity in
group_commentswhen processing comment-only statements can lead to denial of services (bsc#1275466). - Incomplete GHSA-27jp-wm6q-gp25 patch (bsc#1268597).
- Record
openSUSE-SU-2026:21690-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:23561-1 No score
Security update for python-sqlparse
This update for python-sqlparse fixes the following issues:
- CVE-2026-54284: high algorithm complexity when parsing SQL payloads with hundreds of nesting levels can lead to denial of service via excessive resource consumption (bsc#1275459).
- CVE-2026-59893: quadratic complexity when processing unmatched dollar-quoted literal and multiline-comment delimiters can lead to denial of service (bsc#1275461).
- CVE-2026-59894: improper backlash escaping allows for injection of Python or PHP code via a crafted SQL input (bsc#1275460).
- CVE-2026-71491: quadratic complexity in
group_commentswhen processing comment-only statements can lead to denial of services (bsc#1275466). - Incomplete GHSA-27jp-wm6q-gp25 patch (bsc#1268597).
- Record
SUSE-SU-2026:23561-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:3762-1 No score
Security update for python-sqlparse
This update for python-sqlparse fixes the following issues:
- CVE-2026-54284: TokenList.init materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger (bsc#1275459).
- CVE-2026-59893: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (bsc#1275461).
- CVE-2026-59894: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes (bsc#1275460).
- CVE-2026-71491: quadratic O(n2) DoS in group_comments (bsc#1275466).
- Record
SUSE-SU-2026:3762-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:3906-1 No score
Security update for python3-sqlparse
This update for python3-sqlparse fixes the following issues:
- CVE-2026-54284: high algorithm complexity when parsing SQL payloads with hundreds of nesting levels can lead to denial of service via excessive resource consumption (bsc#1275459).
- CVE-2026-59893: quadratic complexity when processing unmatched dollar-quoted literal and multiline-comment delimiters can lead to denial of service (bsc#1275461).
- CVE-2026-59894: improper backlash escaping allows for injection of Python or PHP code via a crafted SQL input (bsc#1275460).
- CVE-2026-71491: quadratic complexity in
group_commentswhen processing comment-only statements can lead to denial of services (bsc#1275466).
- Record
SUSE-SU-2026:3906-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:3907-1 No score
Security update for python-sqlparse
This update for python-sqlparse fixes the following issues:
- CVE-2026-54284: high algorithm complexity when parsing SQL payloads with hundreds of nesting levels can lead to denial of service via excessive resource consumption (bsc#1275459).
- CVE-2026-59893: quadratic complexity when processing unmatched dollar-quoted literal and multiline-comment delimiters can lead to denial of service (bsc#1275461).
- CVE-2026-59894: improper backlash escaping allows for injection of Python or PHP code via a crafted SQL input (bsc#1275460).
- CVE-2026-71491: quadratic complexity in
group_commentswhen processing comment-only statements can lead to denial of services (bsc#1275466).
- Record
SUSE-SU-2026:3907-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:3910-1 No score
Security update for python-sqlparse
This update for python-sqlparse fixes the following issues:
- CVE-2026-54284: TokenList.init materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger (bsc#1275459).
- CVE-2026-59893: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (bsc#1275461).
- CVE-2026-59894: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes (bsc#1275460).
- CVE-2026-71491: quadratic O(n2) DoS in group_comments (bsc#1275466).
- Record
SUSE-SU-2026:3910-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
sqlparsePyPI |
through 0.5.5 | 0.6.0 |
sqlparseDebian:12 |
All versions, plus listed versions 0.4.2-10.4.2-1+deb12u10.4.4-10.5.0-10.5.1-1 Show 6 moreShow less0.5.1-20.5.2-10.5.3-10.5.4-10.5.5-10.5.5-2 |
None known |
sqlparseDebian:13 |
All versions, plus listed versions 0.5.3-10.5.4-10.5.5-10.5.5-2 |
None known |
sqlparseDebian:14 |
All versions, plus listed versions 0.5.3-10.5.4-10.5.5-10.5.5-2 |
None known |
sqlparsePyPI |
before 0.6.0, plus listed versions 0.1.00.1.10.1.100.1.110.1.12 Show 33 moreShow less0.1.130.1.140.1.150.1.160.1.170.1.180.1.190.1.20.1.30.1.40.1.50.1.60.1.70.1.80.1.90.2.00.2.10.2.20.2.30.2.40.3.00.3.10.4.00.4.10.4.20.4.30.4.40.5.00.5.10.5.20.5.30.5.40.5.5 |
0.6.0 |
python-sqlparseopenEuler:24.03-LTS-SP3 From an advisory covering 3 CVEs |
before 0.6.0-1.oe2403sp3 | 0.6.0-1.oe2403sp3 |
python-sqlparseopenEuler:24.03-LTS-SP4 From an advisory covering 3 CVEs |
before 0.6.0-1.oe2403sp4 | 0.6.0-1.oe2403sp4 |
python-sqlparseopenEuler:24.03-LTS-SP1 From an advisory covering 2 CVEs |
before 0.4.4-4.oe2403sp1 | 0.4.4-4.oe2403sp1 |
sqlparseRed Hat Lightwell:PyPI From an advisory covering 5 CVEs |
before 0.5.5+rhlw.1, plus listed versions 0.1.00.1.10.1.100.1.110.1.12 Show 33 moreShow less0.1.130.1.140.1.150.1.160.1.170.1.180.1.190.1.20.1.30.1.40.1.50.1.60.1.70.1.80.1.90.2.00.2.10.2.20.2.30.2.40.3.00.3.10.4.00.4.10.4.20.4.30.4.40.5.00.5.10.5.20.5.30.5.40.5.5 |
0.5.5+rhlw.1 |
python-sqlparseSUSE:Linux Enterprise Server 16.0 From an advisory covering 4 CVEs |
before 0.5.3-160000.4.1 | 0.5.3-160000.4.1 |
Show 28 moreShow less
| Package | Affected | Fixed |
|---|---|---|
python-sqlparseSUSE:Linux Enterprise Server for SAP applications 16.0 From an advisory covering 4 CVEs |
before 0.5.3-160000.4.1 | 0.5.3-160000.4.1 |
python-sqlparseSUSE:Linux Enterprise Module for Package Hub 15 SP7 From an advisory covering 4 CVEs |
before 0.2.4-150100.6.11.1 | 0.2.4-150100.6.11.1 |
python3-sqlparseSUSE:Linux Enterprise Module for Basesystem 15 SP7 From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise Server 15 SP4-LTSS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise Server 15 SP5-LTSS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise Server 15 SP6-LTSS From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise Server for SAP Applications 15 SP4 From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise Server for SAP Applications 15 SP5 From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python3-sqlparseSUSE:Linux Enterprise Server for SAP Applications 15 SP6 From an advisory covering 4 CVEs |
before 0.4.2-150300.23.1 | 0.4.2-150300.23.1 |
python-sqlparseSUSE:Linux Enterprise Module for Public Cloud 15 SP6 From an advisory covering 4 CVEs |
before 0.4.4-150600.3.9.1 | 0.4.4-150600.3.9.1 |
python-sqlparseSUSE:Linux Enterprise Module for Python 3 15 SP7 From an advisory covering 4 CVEs |
before 0.4.4-150600.3.9.1 | 0.4.4-150600.3.9.1 |
python-sqlparseSUSE:Linux Enterprise Server 15 SP6-LTSS From an advisory covering 4 CVEs |
before 0.4.4-150600.3.9.1 | 0.4.4-150600.3.9.1 |
python-sqlparseSUSE:Linux Enterprise Server for SAP Applications 15 SP6 From an advisory covering 4 CVEs |
before 0.4.4-150600.3.9.1 | 0.4.4-150600.3.9.1 |
python-sqlparseSUSE:Linux Enterprise Module for Public Cloud 15 SP4 From an advisory covering 4 CVEs |
before 0.4.4-150400.6.16.1 | 0.4.4-150400.6.16.1 |
python-sqlparseSUSE:Linux Enterprise Module for Public Cloud 15 SP5 From an advisory covering 4 CVEs |
before 0.4.4-150400.6.16.1 | 0.4.4-150400.6.16.1 |
sqlparseUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 0.1.13-2ubuntu20.1.18-10.1.18-1ubuntu0.1~esm1 |
None known |
sqlparseUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 0.2.2-10.2.4-0.10.2.4-0.1ubuntu0.10.2.4-0.1ubuntu0.1+esm1 |
None known |
sqlparseUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 0.2.4-10.2.4-1build10.2.4-20.2.4-30.2.4-3ubuntu0.10.2.4-3ubuntu0.1+esm1 |
None known |
sqlparseUbuntu:22.04:LTS |
All versions, plus listed versions 0.4.1-1ubuntu10.4.2-10.4.2-1ubuntu0.22.04.10.4.2-1ubuntu0.22.04.20.4.2-1ubuntu0.22.04.3 |
None known |
sqlparseUbuntu:24.04:LTS |
All versions, plus listed versions 0.4.2-1ubuntu10.4.4-10.4.4-1ubuntu0.10.4.4-1ubuntu0.2 |
None known |
sqlparseUbuntu:26.10 |
All versions, plus listed versions 0.5.4-10.5.5-20.5.5-2ubuntu1 |
None known |
sqlparseUbuntu:26.04:LTS |
All versions, plus listed versions 0.5.3-10.5.4-10.5.4-1ubuntu0.1 |
None known |
python-sqlparseopenSUSE:Tumbleweed From an advisory covering 4 CVEs |
before 0.6.0-1.1 | 0.6.0-1.1 |
python-sqlparseopenSUSE:Leap 16.0 From an advisory covering 4 CVEs |
before 0.5.3-160000.4.1 | 0.5.3-160000.4.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-59894 is a medium vulnerability (CVSS 6.2) in Andialbrecht Sqlparse, published August 17, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.13%, the 2nd percentile. Fixed in sqlparse 0.6.0.
References
github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x
github.com/andialbrecht/sqlparse/commit/53ff44b53e27cff78259acc1af015506fea60f63
github.com/advisories/GHSA-3496-9g83-7v6x
github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59894.json
nvd.nist.gov/vuln/detail/CVE-2026-59894
security-tracker.debian.org/tracker/CVE-2026-59894
Show 42 moreShow less
github.com/andialbrecht/sqlparse
openeuler.org/zh/security/security-bulletins/detail?id=openEuler-SA-2026-4218
nvd.nist.gov/vuln/detail/CVE-2026-54284
nvd.nist.gov/vuln/detail/CVE-2026-71491
openeuler.org/zh/security/security-bulletins/detail?id=openEuler-SA-2026-4219
openeuler.org/zh/security/security-bulletins/detail?id=openEuler-SA-2026-4320
nvd.nist.gov/vuln/detail/CVE-2026-84305
pypi.org/project/sqlparse
github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54284.json
github.com/andialbrecht/sqlparse/security/advisories/GHSA-pwgv-4x5q-6m9f
github.com/andialbrecht/sqlparse/commit/939b129e24c0ad5d51368b1aa72fffcaca76f06f
github.com/advisories/GHSA-pwgv-4x5q-6m9f
github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59893.json
github.com/andialbrecht/sqlparse/security/advisories/GHSA-prg7-hcfm-mfcr
nvd.nist.gov/vuln/detail/CVE-2026-59893
github.com/andialbrecht/sqlparse/commit/d1d80602741f77ec78e5a04ce4719244cf32352e
github.com/advisories/GHSA-prg7-hcfm-mfcr
github.com/CVEProject/cvelistV5/tree/main/cves/2026/71xxx/CVE-2026-71491.json
github.com/andialbrecht/sqlparse/security/advisories/GHSA-f2ff-p2ww-7p4p
github.com/andialbrecht/sqlparse/commit/ef2012a5eeb491e604dea2b00d516904a3830c87
github.com/advisories/GHSA-f2ff-p2ww-7p4p
github.com/andialbrecht/sqlparse/releases/tag/0.6.0
github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84305.json
github.com/andialbrecht/sqlparse/security/advisories/GHSA-cfqr-cjx5-5jcm
github.com/andialbrecht/sqlparse/commit/a51df6d9e2d31b44be9adb6bc8732517db6bf96b
github.com/advisories/GHSA-cfqr-cjx5-5jcm
suse.com/support/update/announcement/2026/suse-su-202623561-1
bugzilla.suse.com/1268597
bugzilla.suse.com/1275459
bugzilla.suse.com/1275460
bugzilla.suse.com/1275461
bugzilla.suse.com/1275466
suse.com/security/cve/CVE-2026-54284
suse.com/security/cve/CVE-2026-59893
suse.com/security/cve/CVE-2026-59894
suse.com/security/cve/CVE-2026-71491
suse.com/support/update/announcement/2026/suse-su-20263762-1
suse.com/support/update/announcement/2026/suse-su-20263906-1
suse.com/support/update/announcement/2026/suse-su-20263907-1
suse.com/support/update/announcement/2026/suse-su-20263910-1
ubuntu.com/security/CVE-2026-59894
cve.org/CVERecord?id=CVE-2026-59894