sqlparse vulnerabilities

A non-validating SQL parser.

Registry
PyPI
Latest
0.6.1
License
BSD License

9 known advisories

The latest version, 0.6.1, is not affected by any of them. Projects on older versions may be.

Update to the latest version:pip install 'sqlparse>=0.6.1'

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

Security advisories for sqlparse

  • 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
  • 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

Is your sqlparse version vulnerable?

Which of your client projects still run an old sqlparse?

NPMscan reads the requirements.txt, poetry.lock, uv.lock and Pipfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other PyPI packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the PyPI registry.