Update dependency sqlparse to v0.5.4 [SECURITY] - #105
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
|
renovate
Bot
force-pushed
the
renovate/pypi-sqlparse-vulnerability
branch
2 times, most recently
from
November 11, 2025 02:28
675deae to
25262b5
Compare
|
renovate
Bot
force-pushed
the
renovate/pypi-sqlparse-vulnerability
branch
from
February 13, 2026 18:44
25262b5 to
5cc106b
Compare
|
renovate
Bot
force-pushed
the
renovate/pypi-sqlparse-vulnerability
branch
2 times, most recently
from
March 30, 2026 22:01
5cc106b to
9f8e02d
Compare
renovate
Bot
force-pushed
the
renovate/pypi-sqlparse-vulnerability
branch
from
April 28, 2026 01:16
9f8e02d to
87c010b
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




This PR contains the following updates:
==0.4.4→==0.5.4sqlparse parsing heavily nested list leads to Denial of Service
CVE-2024-4340 / GHSA-2m57-hf25-phgg
More information
Details
Summary
Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.
Details + PoC
Running the following code will raise Maximum recursion limit exceeded exception:
We expect a traceback of RecursionError:
Fix suggestion
The flatten() function of TokenList class should limit the recursion to a maximal depth:
Impact
Denial of Service (the impact depends on the use).
Anyone parsing a user input with sqlparse.parse() is affected.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
sqlparse: formatting list of tuples leads to denial of service
GHSA-27jp-wm6q-gp25
More information
Details
Summary
The below gist hangs while attempting to format a long list of tuples.
This was found while drafting a regression test for Dja
ngo 5.2's composite primary key feature, which allows querying composite fields with tuples.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
andialbrecht/sqlparse (sqlparse)
v0.5.4Compare Source
Enhancements
for PEP 561 compliance, enabling type checking with mypy and other tools
(issue756).
to automatically format SQL files. The CLI now supports multiple files and
an
--in-placeflag for in-place editing (issue537).ATTACHandDETACHto PostgreSQL keywords (pr808).INTERSECTto close keywords in WHERE clause (pr820).REGEXP BINARYcomparison operator (pr817).Bug Fixes
very large lists of tuples. This enhances the existing recursion protections
with configurable limits for token processing to prevent DoS through
algorithmic complexity attacks. The new limits (MAX_GROUPING_DEPTH=100,
MAX_GROUPING_TOKENS=10000) can be adjusted or disabled (by setting to None)
if needed for legitimate large SQL statements.
comments (issue801, pr803 by stropysh).
blocks (issue812).
v0.5.3Compare Source
Bug Fixes
service attack (DOS) due to recursion errors for deeply nested statements.
Brought up and fixed by @living180. Thanks a lot!
v0.5.2Compare Source
Bug Fixes
v0.5.1Compare Source
Enhancements
a more compact output by avoiding some line breaks (issue783).
Bug Fixes
whitespace (issue772).
Note: In some cases you might want to add
strip_whitespace=Truewhere youpreviously used just
strip_comments=True.strip_commentsdid some of thework that
strip_whitespaceshould do.within a BEGIN block (issue784).
NULLS LAST (issue532).
v0.5.0Compare Source
Notable Changes
error for deeply nested statements. Instead of recursion error a generic
SQLParseError is raised. See the security advisory for details:
GHSA-2m57-hf25-phgg
The vulnerability was discovered by @uriyay-jfrog. Thanks for reporting!
Enhancements
Some database backends love statements without semicolon (issue742).
Bug Fixes
by josuc1, thanks for bringing this up!).
Other
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.