{"id":"UBUNTU-CVE-2026-71491","details":"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.","modified":"2026-08-19T13:32:43.656868959Z","published":"2026-08-17T18:18:00Z","upstream":["CVE-2026-71491"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-71491"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-71491"},{"type":"REPORT","url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-f2ff-p2ww-7p4p"}],"affected":[{"package":{"name":"sqlparse","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/sqlparse?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.1.13-2ubuntu2","0.1.18-1"],"ecosystem_specific":{"binaries":[{"binary_name":"pypy-sqlparse","binary_version":"0.1.18-1"},{"binary_name":"python-sqlparse","binary_version":"0.1.18-1"},{"binary_name":"python3-sqlparse","binary_version":"0.1.18-1"},{"binary_version":"0.1.18-1","binary_name":"sqlformat"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-71491.json"}},{"package":{"name":"sqlparse","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/sqlparse?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.2-1","0.2.4-0.1","0.2.4-0.1ubuntu0.1"],"ecosystem_specific":{"binaries":[{"binary_version":"0.2.4-0.1ubuntu0.1","binary_name":"pypy-sqlparse"},{"binary_name":"python-sqlparse","binary_version":"0.2.4-0.1ubuntu0.1"},{"binary_version":"0.2.4-0.1ubuntu0.1","binary_name":"python3-sqlparse"},{"binary_name":"sqlformat","binary_version":"0.2.4-0.1ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-71491.json"}},{"package":{"name":"sqlparse","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/sqlparse?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.4-1","0.2.4-1build1","0.2.4-2","0.2.4-3","0.2.4-3ubuntu0.1"],"ecosystem_specific":{"binaries":[{"binary_version":"0.2.4-3ubuntu0.1","binary_name":"pypy-sqlparse"},{"binary_name":"python3-sqlparse","binary_version":"0.2.4-3ubuntu0.1"},{"binary_name":"sqlformat","binary_version":"0.2.4-3ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-71491.json"}},{"package":{"name":"sqlparse","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/sqlparse?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.4.1-1ubuntu1","0.4.2-1","0.4.2-1ubuntu0.22.04.1","0.4.2-1ubuntu0.22.04.2"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-sqlparse","binary_version":"0.4.2-1ubuntu0.22.04.2"},{"binary_name":"sqlformat","binary_version":"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-71491.json"}},{"package":{"name":"sqlparse","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/sqlparse?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.4.2-1ubuntu1","0.4.4-1","0.4.4-1ubuntu0.1"],"ecosystem_specific":{"binaries":[{"binary_version":"0.4.4-1ubuntu0.1","binary_name":"python3-sqlparse"},{"binary_name":"sqlformat","binary_version":"0.4.4-1ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-71491.json"}},{"package":{"name":"sqlparse","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/sqlparse?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.5.3-1","0.5.4-1"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-sqlparse","binary_version":"0.5.4-1"},{"binary_name":"sqlformat","binary_version":"0.5.4-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-71491.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"},{"type":"Ubuntu","score":"medium"}]}