CVE-2021-32839

Summary

CVECVE-2021-32839
StatePUBLIC
Assigner[email protected]
Source PriorityCVE Program / NVD first with legacy fallback
Published2021-09-20 17:15:00 UTC
Updated2021-09-29 15:04:00 UTC
Descriptionsqlparse is a non-validating SQL parser module for Python. In sqlparse versions 0.4.0 and 0.4.1 there is a regular Expression Denial of Service in sqlparse vulnerability. The regular expression may cause exponential backtracking on strings containing many repetitions of '\r\n' in SQL comments. Only the formatting feature that removes comments from SQL statements is affected by this regular expression. As a workaround don't use the sqlformat.format function with keyword strip_comments=True or the --strip-comments command line flag when using the sqlformat command line tool. The issues has been fixed in sqlparse 0.4.2.

Risk And Classification

Problem Types: CWE-400

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Sqlparse Project Sqlparse All All All All

References

ReferenceSourceLinkTags
StripComments filter contains a regular expression that is vulnerable to ReDOS (Regular Expression Denial of Service) · Advisory · andialbrecht/sqlparse · GitHub CONFIRM github.com
Optimize regular expression for identifying line breaks in comments. · andialbrecht/sqlparse@8238a9e · GitHub MISC github.com
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Legacy QID Mappings

  • 184111 Debian Security Update for sqlparse (CVE-2021-32839)
  • 198509 Ubuntu Security Notification for SQL parse Vulnerability (USN-5085-1)
  • 240566 Red Hat Update for Satellite 6.11 Release (RHSA-2022:5498)
  • 501906 Alpine Linux Security Update for py3-sqlparse
  • 751426 OpenSUSE Security Update for python-sqlparse (openSUSE-SU-2021:3857-1)
  • 960505 Rocky Linux Security Update for Satellite (RLSA-2022:5498)
  • 980660 Python (pip) Security Update for sqlparse (GHSA-p5w8-wqhj-9hhf)
© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

CVE.report and Source URL Uptime Status status.cve.report