Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

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

Quick assessment

Affected
andialbrecht sqlparse
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Andi Albrecht sqlparse是Andi Albrecht个人开发者的一个解析SQL语句的库。 Andi Albrecht sqlparse 0.6.0之前版本存在资源管理错误漏洞,该漏洞源于sqlparse.format(sql, reindent=True)和sqlformat --reindent将攻击者控制的括号元组列表通过ReindentFilter._get_offset()函数处理,其中_flatten_up_to_token()函数重复重建和连接语句前缀,导致二次CPU消耗,

CVSS 5.1 · Medium EPSS 0.19% · P8

Affected Version Matrix 1

VendorProduct Version RangeStatus
andialbrecht sqlparse < 0.6.0 affected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-84305

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
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
Source: CVE Program / CVE List V5
Vulnerability Type
算法复杂性
Source: CVE Program / CVE List V5
Vulnerability Title
Andi Albrecht sqlparse 资源管理错误漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Andi Albrecht sqlparse是Andi Albrecht个人开发者的一个解析SQL语句的库。 Andi Albrecht sqlparse 0.6.0之前版本存在资源管理错误漏洞,该漏洞源于sqlparse.format(sql, reindent=True)和sqlformat --reindent将攻击者控制的括号元组列表通过ReindentFilter._get_offset()函数处理,其中_flatten_up_to_token()函数重复重建和连接语句前缀,导致二次CPU消耗,
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
andialbrecht sqlparse < 0.6.0 -

II. Public POCs for CVE-2026-84305

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-84305

请登录查看更多情报信息。

Patches & Fixes for CVE-2026-84305 (1)

Vendor Advisories for CVE-2026-84305 (1)

Vendor Pages for CVE-2026-84305 (1)

IV. Related Vulnerabilities

V. Comments for CVE-2026-84305

No comments yet


Leave a comment