{"id":"UBUNTU-CVE-2026-84305","details":"sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse.format(sql, reindent=True) and sqlformat --reindent route attacker-controlled parenthesized tuple lists through ReindentFilter._get_offset() in sqlparse/filters/reindent.py, where _flatten_up_to_token() repeatedly rebuilds and joins the statement prefix. Thousands of offset calculations walk an expanding token tree, producing quadratic CPU consumption for inputs that remain below MAX_GROUPING_TOKENS and causing request delays, reduced throughput, or worker starvation. This issue is fixed in version 0.6.0.","modified":"2026-09-16T14:02:37.817772916Z","published":"2026-09-01T19:17:00Z","upstream":["CVE-2026-84305"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-84305"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-84305"},{"type":"REPORT","url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-cfqr-cjx5-5jcm"}],"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_version":"0.1.18-1","binary_name":"pypy-sqlparse"},{"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-84305.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_version":"0.2.4-0.1ubuntu0.1","binary_name":"python-sqlparse"},{"binary_name":"python3-sqlparse","binary_version":"0.2.4-0.1ubuntu0.1"},{"binary_version":"0.2.4-0.1ubuntu0.1","binary_name":"sqlformat"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-84305.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_name":"pypy-sqlparse","binary_version":"0.2.4-3ubuntu0.1"},{"binary_name":"python3-sqlparse","binary_version":"0.2.4-3ubuntu0.1"},{"binary_version":"0.2.4-3ubuntu0.1","binary_name":"sqlformat"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-84305.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_version":"0.4.2-1ubuntu0.22.04.2","binary_name":"python3-sqlparse"},{"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-84305.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-84305.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_version":"0.5.4-1","binary_name":"python3-sqlparse"},{"binary_version":"0.5.4-1","binary_name":"sqlformat"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-84305.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"},{"type":"Ubuntu","score":"medium"}]}