# CVE-2026-84305: sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption

- Severity: Medium 5.1 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 8% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-09-01T18:33:10.969Z
- Modified: 2026-09-10T12:25:55.468Z
- Also known as: GHSA-cfqr-cjx5-5jcm, PYSEC-2026-3923
- Weaknesses: CWE-407
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- andialbrecht sqlparse: < 0.6.0
- sqlparse (PyPI): before 0.6.0

## Every score

- GitHub_M: CVSS:4.0 5.1 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- PyPA Advisory Database: CVSS:4.0 `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`

## References

- <https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-cfqr-cjx5-5jcm> (exploit, web)
- <https://github.com/andialbrecht/sqlparse/commit/a51df6d9e2d31b44be9adb6bc8732517db6bf96b> (web)
- <https://github.com/andialbrecht/sqlparse/releases/tag/0.6.0> (web)
- <https://github.com/andialbrecht/sqlparse> (package)
- <https://pypi.org/project/sqlparse> (package)
- <https://github.com/advisories/GHSA-cfqr-cjx5-5jcm> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-84305> (advisory)

## Sources

- CVE List: [CVE-2026-84305](https://www.cve.org/CVERecord?id=CVE-2026-84305), CVE Terms of Use, modified 2026-09-01
- GitHub Advisory Database: [GHSA-cfqr-cjx5-5jcm](https://github.com/advisories/GHSA-cfqr-cjx5-5jcm), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-84305](https://nvd.nist.gov/vuln/detail/CVE-2026-84305), Public domain, modified 2026-09-09
- PyPA Advisory Database: [PYSEC-2026-3923](https://osv.dev/vulnerability/PYSEC-2026-3923), CC-BY-4.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2026-84305 · Whole record: https://cve.day/CVE-2026-84305.json · Rebuilt by cve.day 2026-11-25T22:59:35.992Z
