GHSA-27jp-wm6q-gp25: sqlparse Denial of Service Vulnerability
MODERATEGHSA-27jp-wm6q-gp25 is a MODERATE denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting sqlparse libraries in the PyPI ecosystem. The issue involves formatting list of tuples leads to denial of service. Remediation is available by upgrading affected packages to version 0.5.4.
GHSA-27jp-wm6q-gp25 at a Glance
How to Fix GHSA-27jp-wm6q-gp25
To remediate this vulnerability, upgrade all affected sqlparse dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install sqlparse>=0.5.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show sqlparse
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-27jp-wm6q-gp25, inspect your installed packages using pip:
pip show sqlparse
Analyze the terminal output to locate any version of sqlparse in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.4), your application is affected.
Note: The pip show sqlparse command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In sqlparse, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-27jp-wm6q-gp25 Affected sqlparse Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sqlparse
|
PyPI |
< 0.5.4
|
0.5.4
|
References
Frequently Asked Questions
What is GHSA-27jp-wm6q-gp25?
Which sqlparse versions are affected?
What version fixes GHSA-27jp-wm6q-gp25?
Is sqlparse affected?
What CWE is associated with GHSA-27jp-wm6q-gp25?
How can I check PyPI dependencies for GHSA-27jp-wm6q-gp25?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-27jp-wm6q-gp25",
"modified" : "2026-02-13T16:16:11Z",
"published" : "2026-02-13T16:16:11Z",
"aliases" : [ ],
"summary" : "sqlparse: formatting list of tuples leads to denial of service",
"details" : "### Summary\nThe below gist hangs while attempting to format a long list of tuples.\n\nThis was found while [drafting a regression test for Dja\nngo 5.2's composite primary key feature](https://code.djangoproject.com/ticket/36416#comment:3), which allows querying composite fields with tuples.\n\n###",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "sqlparse"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.5.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-27jp-wm6q-gp25"
}, {
"type" : "WEB",
"url" : "https://github.com/andialbrecht/sqlparse/commit/40ed3aa958657fa4a82055927fa9de70ab903360"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/andialbrecht/sqlparse"
}, {
"type" : "WEB",
"url" : "https://github.com/andialbrecht/sqlparse/releases/tag/0.5.4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-13T16:16:11Z",
"nvd_published_at" : null
}
}