Is sqlparse 0.4 vulnerable?

PyPI · 5 releases from 0.4.0 to 0.4.4 · latest sqlparse is 0.6.1 · checked 18 Nov 2026

Yes: 7 known advisories

Yes. sqlparse 0.4.4, the last 0.4 release, is affected by 7 known security advisories (4 high, 3 medium), including CVE-2026-59893, CVE-2026-54284, CVE-2026-71491. 2 more affect earlier 0.4.x releases. Upgrade to 0.6.0 or later to fix all of them.

Upgrade with:pip install 'sqlparse>=0.6.0'

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

Advisories affecting sqlparse 0.4.4

  • MediumCVE-2026-84305GHSA-cfqr-cjx5-5jcm1 Sept 2026

    sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption

    Affected
    <0.6.0
    Fixed in
    0.6.0
  • HighCVE-2026-59893GHSA-prg7-hcfm-mfcr17 Aug 2026

    sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)

    Affected
    <0.6.0
    Fixed in
    0.6.0
  • HighCVE-2026-54284GHSA-pwgv-4x5q-6m9f17 Aug 2026

    sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger

    Affected
    <0.6.0
    Fixed in
    0.6.0
  • HighCVE-2026-71491GHSA-f2ff-p2ww-7p4p17 Aug 2026

    sqlparse: Quadratic O(n²) DoS in group_comments

    Affected
    <0.6.0
    Fixed in
    0.6.0
  • MediumCVE-2026-59894GHSA-3496-9g83-7v6x17 Aug 2026

    sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes

    Affected
    <0.6.0
    Fixed in
    0.6.0
  • MediumGHSA-27jp-wm6q-gp2513 Feb 2026

    sqlparse: formatting list of tuples leads to denial of service

    Affected
    <0.5.4
    Fixed in
    0.5.4
  • HighCVE-2024-4340GHSA-2m57-hf25-phgg15 Apr 2024

    sqlparse parsing heavily nested list leads to Denial of Service

    Affected
    <0.5.0
    Fixed in
    0.5.0

Fixed within 0.4.x, affecting earlier releases

  • MediumCVE-2023-30608GHSA-rrm6-wvj7-cwh221 Apr 2023

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

    Affected
    >=0.1.15 <0.4.4
    Fixed in
    0.4.4
  • HighCVE-2021-32839GHSA-p5w8-wqhj-9hhf10 Sept 2021

    StripComments filter contains a regular expression that is vulnerable to ReDOS (Regular Expression Denial of Service)

    Affected
    >=0.4.0 <0.4.2
    Fixed in
    0.4.2

Every sqlparse 0.4.x release

Affected: 0.4.0 to 0.4.4. Latest sqlparse: 0.6.1.

VersionKnown advisories
sqlparse 0.4.4CVE-2026-84305, CVE-2026-59893, CVE-2026-54284, CVE-2026-71491, CVE-2026-59894, GHSA-27jp-wm6q-gp25, CVE-2024-4340
sqlparse 0.4.3CVE-2026-84305, CVE-2026-59893, CVE-2026-54284, CVE-2026-71491, CVE-2026-59894, GHSA-27jp-wm6q-gp25, CVE-2024-4340, CVE-2023-30608
sqlparse 0.4.2CVE-2026-84305, CVE-2026-59893, CVE-2026-54284, CVE-2026-71491, CVE-2026-59894, GHSA-27jp-wm6q-gp25, CVE-2024-4340, CVE-2023-30608
sqlparse 0.4.1CVE-2026-84305, CVE-2026-59893, CVE-2026-54284, CVE-2026-71491, CVE-2026-59894, GHSA-27jp-wm6q-gp25, CVE-2024-4340, CVE-2023-30608, CVE-2021-32839
sqlparse 0.4.0CVE-2026-84305, CVE-2026-59893, CVE-2026-54284, CVE-2026-71491, CVE-2026-59894, GHSA-27jp-wm6q-gp25, CVE-2024-4340, CVE-2023-30608, CVE-2021-32839

Which of your client projects are still on sqlparse 0.4?

NPMscan reads the lockfiles in every GitHub repo you pick, finds the exact sqlparse version each one installs, and checks it against these advisories. Each finding comes with the command that fixes it.

Other sqlparse versions

Advisory data from OSV.dev (opens OSV.dev in a new tab), which includes the GitHub Advisory Database. Release list from the PyPI registry. Refreshed daily.