MediumGHSA-rrm6-wvj7-cwh2CVE-2023-30608PYSEC-2023-87

sqlparse contains a regular expression that is vulnerable to Regular Expression Denial of Service

Published 21 Apr 2023 · Updated 4 Nov 2025

Is your project on an affected sqlparse?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
>=0.1.15 <0.4.4
Fixed in
0.4.4
Update to the fixed version for your release line, for example:pip install 'sqlparse>=0.4.4'

Details

Impact

The SQL parser contains a regular expression that is vulnerable to ReDoS (Regular Expression Denial of Service). The vulnerability may lead to Denial of Service (DoS).

Patches

This issues has been fixed in sqlparse 0.4.4.

Workarounds

None.

References

This issue was discovered and reported by GHSL team member @erik-krogh (Erik Krogh Kristensen).

  • Commit that introduced the vulnerability: e75e35869473832a1eb67772b1adfee2db11b85a

Is GHSA-rrm6-wvj7-cwh2 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sqlparse, and gives you the command that fixes it.

More advisories for sqlparse

  • MediumCVE-2026-84305sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption · 1 Sept 2026
  • HighCVE-2026-59893sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service) · 17 Aug 2026
  • HighCVE-2026-54284sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger · 17 Aug 2026
  • HighCVE-2026-71491sqlparse: Quadratic O(n²) DoS in group_comments · 17 Aug 2026
  • MediumCVE-2026-59894sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes · 17 Aug 2026
  • MediumGHSA-27jp-wm6q-gp25sqlparse: formatting list of tuples leads to denial of service · 13 Feb 2026
All 9 advisories for sqlparse

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.