Skip to content
Heist/ feed
UnratedFix available

UBUNTU-CVE-2026-59893

Type: advisorySource: OSV1 source record

sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, SQL_REGEX in sqlparse/keywords.py and the per-position loop in sqlparse/lexer.py repeatedly scan unmatched dollar-quoted literal and multiline-comment delimiters, causing quadratic CPU consumption through sqlparse.parse(), sqlparse.format(), and sqlparse.split(). This issue is fixed in version 0.6.0.

Announced Group revision 1
Original source ↗

UBUNTU-CVE-2026-59893

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:UBUNTU-CVE-2026-59893

sqlparse

Source reference: /affected/0/package/name

Affected versions
0.2.2-1

Source reference: /affected/0/versions

0.2.4-0.1

Source reference: /affected/0/versions

0.2.4-0.1ubuntu0.1

Source reference: /affected/0/versions

Fixed versions
0.2.4-0.1ubuntu0.1+esm1

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

sqlparse

Source reference: /affected/1/package/name

Affected versions
0.2.4-1

Source reference: /affected/1/versions

0.2.4-1build1

Source reference: /affected/1/versions

0.2.4-2

Source reference: /affected/1/versions

0.2.4-3

Source reference: /affected/1/versions

0.2.4-3ubuntu0.1

Source reference: /affected/1/versions

Fixed versions
0.2.4-3ubuntu0.1+esm1

Source reference: /affected/1/ranges

Prerequisites
Not stated in this record

sqlparse

Source reference: /affected/2/package/name

Affected versions
0.4.1-1ubuntu1

Source reference: /affected/2/versions

0.4.2-1

Source reference: /affected/2/versions

0.4.2-1ubuntu0.22.04.1

Source reference: /affected/2/versions

0.4.2-1ubuntu0.22.04.2

Source reference: /affected/2/versions

Fixed versions
0.4.2-1ubuntu0.22.04.3

Source reference: /affected/2/ranges

Prerequisites
Not stated in this record

sqlparse

Source reference: /affected/3/package/name

Affected versions
0.4.2-1ubuntu1

Source reference: /affected/3/versions

0.4.4-1

Source reference: /affected/3/versions

0.4.4-1ubuntu0.1

Source reference: /affected/3/versions

Fixed versions
0.4.4-1ubuntu0.2

Source reference: /affected/3/ranges

Prerequisites
Not stated in this record

sqlparse

Source reference: /affected/4/package/name

Affected versions
0.5.3-1

Source reference: /affected/4/versions

0.5.4-1

Source reference: /affected/4/versions

Fixed versions
0.5.4-1ubuntu0.1

Source reference: /affected/4/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.2.4-0.1ubuntu0.1+esm1"
          }
        ]
      }
    ],
    "package": {
      "name": "sqlparse",
      "purl": "pkg:deb/ubuntu/sqlparse?arch=source&distro=esm-infra%2Fbionic",
      "ecosystem": "Ubuntu:Pro:18.04:LTS"
    },
    "versions": [
      "0.2.2-1",
      "0.2.4-0.1",
      "0.2.4-0.1ubuntu0.1"
    ],
    "database_specific": {
      "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-59893.json"
    },
    "ecosystem_specific": {
      "binaries": [
        {
          "binary_name": "pypy-sqlparse",
          "binary_version": "0.2.4-0.1ubuntu0.1+esm1"
        },
        {
          "binary_name": "python-sqlparse",
          "binary_version": "0.2.4-0.1ubuntu0.1+esm1"
        },
        {
          "binary_name": "python3-sqlparse",
          "binary_version": "0.2.4-0.1ubuntu0.1+esm1"
        },
        {
          "binary_name": "sqlformat",
          "binary_version": "0.2.4-0.1ubuntu0.1+esm1"
        }
      ],
      "availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro"
    }
  },
  {
    "ranges": [
      {
        "type": "ECOSYSTEM",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "0.2.4-3ubuntu0.1+esm1"
          }
        ]
      }
    ],
    "package": {
      "name": "sqlparse",
      "purl": "pkg:deb/ubuntu/sqlparse?arch=source&distro=esm-infra%2Ffocal",
      "ecosystem": "Ubuntu:Pro:20.04:LTS"
    },
    "versions": [
      "0.2.4-1",
      "0.2.4-1build1",
      "0.2.4-2",
      "0.2.4-3",
      "0.2.4-3ubuntu0.1"
    ],
    "database_specific": {
      "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-59893.json"
    },
    "ecosystem_specific": {
      "binaries": [
        {
          "binary_name": "pypy-sqlparse",
          "binary_version": "0.2.4-3ubuntu0.1+esm1"
        },
        {
          "binary_name": "python3-sqlparse",
          "binary_version": "0.2.4-3ubuntu0.1+esm1"
        },
        {
          "binary_name": "sqlformat",
          "binary_version": "0.2.4-3ubuntu0.1+esm1"
        }
      ],
      "availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro"
    }
  },
  {
    "ranges": [
      {
        "type": "ECOSYSTEM",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "0.4.2-1ubuntu0.22.04.3"
          }
        ]
      }
    ],
    "package": {
      "name": "sqlparse",
      "purl": "pkg:deb/ubuntu/sqlparse?arch=source&distro=jammy",
      "ecosystem": "Ubuntu:22.04:LTS"
    },
    "versions": [
      "0.4.1-1ubuntu1",
      "0.4.2-1",
      "0.4.2-1ubuntu0.22.04.1",
      "0.4.2-1ubuntu0.22.04.2"
    ],
    "database_specific": {
      "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-59893.json"
    },
    "ecosystem_specific": {
      "binaries": [
        {
          "binary_name": "python3-sqlparse",
          "binary_version": "0.4.2-1ubuntu0.22.04.3"
        },
        {
          "binary_name": "sqlformat",
          "binary_version": "0.4.2-1ubuntu0.22.04.3"
        }
      ],
      "availability": "No subscription required"
    }
  },
  {
    "ranges": [
      {
        "type": "ECOSYSTEM",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "0.4.4-1ubuntu0.2"
          }
        ]
      }
    ],
    "package": {
      "name": "sqlparse",
      "purl": "pkg:deb/ubuntu/sqlparse?arch=source&distro=noble",
      "ecosystem": "Ubuntu:24.04:LTS"
    },
    "versions": [
      "0.4.2-1ubuntu1",
      "0.4.4-1",
      "0.4.4-1ubuntu0.1"
    ],
    "database_specific": {
      "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-59893.json"
    },
    "ecosystem_specific": {
      "binaries": [
        {
          "binary_name": "python3-sqlparse",
          "binary_version": "0.4.4-1ubuntu0.2"
        },
        {
          "binary_name": "sqlformat",
          "binary_version": "0.4.4-1ubuntu0.2"
        }
      ],
      "availability": "No subscription required"
    }
  },
  {
    "ranges": [
      {
        "type": "ECOSYSTEM",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "0.5.4-1ubuntu0.1"
          }
        ]
      }
    ],
    "package": {
      "name": "sqlparse",
      "purl": "pkg:deb/ubuntu/sqlparse?arch=source&distro=resolute",
      "ecosystem": "Ubuntu:26.04:LTS"
    },
    "versions": [
      "0.5.3-1",
      "0.5.4-1"
    ],
    "database_specific": {
      "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-59893.json"
    },
    "ecosystem_specific": {
      "binaries": [
        {
          "binary_name": "python3-sqlparse",
          "binary_version": "0.5.4-1ubuntu0.1"
        },
        {
          "binary_name": "sqlformat",
          "binary_version": "0.5.4-1ubuntu0.1"
        }
      ],
      "availability": "No subscription required"
    }
  }
]

Publisher severity

No explicit severity was provided.

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