Skip to content
Heist/ feed
HighFix available

python-sqlparse security update

Type: advisorySource: OSV1 source record

A non-validating SQL parser. Security Fix(es): sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, TokenList construction and string conversion in sqlparse/sql.py repeatedly flatten nested token subtrees constructed by group_parenthesis and group_case, causing quadratic CPU consumption through sqlparse.parse(), sqlparse.format(), and sqlparse.split() before depth and token limits terminate processing. This issue is fixed in version 0.6.0.(CVE-2026-54284) sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.(CVE-2026-59894) sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, group_comments in sqlparse/engine/grouping.py repeatedly rescans comment-only statements before the MAX_GROUPING_TOKENS guard, causing quadratic CPU consumption through sqlparse.parse() and sqlparse.format(sql, strip_comments=True). This issue is fixed in version 0.6.0.(CVE-2026-71491)

Announced Group revision 1
Original source ↗

OESA-2026-4218

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:OESA-2026-4218

python-sqlparse

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
Fixed versions
0.6.0-1.oe2403sp3

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "ECOSYSTEM",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "0.6.0-1.oe2403sp3"
          }
        ]
      }
    ],
    "package": {
      "name": "python-sqlparse",
      "purl": "pkg:rpm/openEuler/python-sqlparse&distro=openEuler-24.03-LTS-SP3",
      "ecosystem": "openEuler:24.03-LTS-SP3"
    },
    "database_specific": {
      "source": "https://repo.openeuler.org/security/data/osv/OESA-2026-4218.json"
    },
    "ecosystem_specific": {
      "src": [
        "python-sqlparse-0.6.0-1.oe2403sp3.src.rpm"
      ],
      "noarch": [
        "python3-sqlparse-0.6.0-1.oe2403sp3.noarch.rpm"
      ]
    }
  }
]

Publisher severity

high

Source reference: /database_specific/severity

Event
#52157 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement