Resource Exhaustion Affecting python3-sqlparse package, versions <0.4.2-3.3.1


Severity

Recommended
0.0
medium
0
10

Based on SUSE Linux Enterprise Server security rating.

Threat Intelligence

EPSS
0.11% (46th 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-SLES153-PYTHON3SQLPARSE-2652880
  • published14 Apr 2022
  • disclosed1 Dec 2021

Introduced: 1 Dec 2021

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

How to fix?

Upgrade SLES:15.3 python3-sqlparse to version 0.4.2-3.3.1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream python3-sqlparse package and not the python3-sqlparse package as distributed by SLES. See How to fix? for SLES:15.3 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