PT-2021-6509 · Pypi+4 · Sqlparse+4
Erik-Krogh
+1
·
Published
2021-09-10
·
Updated
2024-12-21
·
CVE-2021-32839
CVSS v4.0
8.7
High
| Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
Name of the Vulnerable Software and Affected Versions
sqlparse versions 0.4.0 through 0.4.1
Description
The issue is related to a regular Expression Denial of Service in the sqlparse module for Python. The regular expression may cause exponential backtracking on strings containing many repetitions of
r in SQL comments. This affects the formatting feature that removes comments from SQL statements.Recommendations
For sqlparse versions 0.4.0 and 0.4.1, as a workaround, do not use the
sqlformat.format function with keyword strip comments=True or the --strip-comments command line flag when using the sqlformat command line tool.
For sqlparse versions 0.4.0 and 0.4.1, update to sqlparse 0.4.2 to fix the issue.Fix
DoS
Resource Exhaustion
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Alt Linux
Rocky Linux
Suse
Ubuntu
Sqlparse