Resource Exhaustion Affecting python-sqlparse package, versions *


Severity

Recommended
medium

Based on Red Hat Enterprise Linux security rating.

Threat Intelligence

Exploit Maturity
Not Defined
EPSS
0.11% (47th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Resource Exhaustion vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RHEL7-PYTHONSQLPARSE-5248114
  • published26 Mar 2023
  • disclosed10 Sept 2021

Introduced: 10 Sep 2021

CVE-2021-32839  (opens in a new tab)
CWE-400  (opens in a new tab)

How to fix?

There is no fixed version for RHEL:7 python-sqlparse.

NVD Description

Note: Versions mentioned in the description apply only to the upstream python-sqlparse package and not the python-sqlparse package as distributed by RHEL. See How to fix? for RHEL:7 relevant fixed versions and status.

sqlparse 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.

CVSS Scores

version 3.1