Resource Exhaustion Affecting python3-sqlparse package, versions *


Severity

Recommended
medium

Based on Red Hat Enterprise Linux security rating.

Threat Intelligence

EPSS
2.34% (83rd 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 IDSNYK-RHEL7-PYTHON3SQLPARSE-4474690
  • 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 python3-sqlparse.

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 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 Base Scores

version 3.1