Summary
It was discovered that SQL parse contained multiple algorithmic complexity
flaws when parsing SQL statements with deeply nested parentheses, comments,
or dollar-quoted string literals. An attacker could use this issue to cause
SQL parse to consume excessive CPU resources, resulting in a denial of
service.
Fixed packages 6
| Release | Package | Fixed in |
|---|---|---|
| Ubuntu · 22.04 LTS 22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.3 |
| Ubuntu · 24.04 LTS 24.04:LTS | sqlparse | 0.4.4-1ubuntu0.2 |
| Ubuntu · 26.04 LTS 26.04:LTS | sqlparse | 0.5.4-1ubuntu0.1 |
| Ubuntu · Pro 16.04 LTS Pro:16.04:LTS | sqlparse | 0.1.18-1ubuntu0.1~esm1 |
| Ubuntu · Pro 18.04 LTS Pro:18.04:LTS | sqlparse | 0.2.4-0.1ubuntu0.1+esm1 |
| Ubuntu · Pro 20.04 LTS Pro:20.04:LTS | sqlparse | 0.2.4-3ubuntu0.1+esm1 |
Vulnerabilities 3
-
High 8.7
sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, TokenList construction and string conversion in sqlparse/sql.py repeatedly flatten nested token subtrees constructed by group_parenthesis and group_case, causing quadratic CPU consumpt…
-
High 8.7
sqlparse: Quadratic O(n²) DoS in group_comments
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(…
-
High 7.5
sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)
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…