Security mailing lists by PureSourceCode

CVE-2021-32839

HIGH 7.5CVSS 3.1

StripComments filter contains a regular expression that is vulnerable to ReDOS (Regular Expression Denial of Service)

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.

Published
20 Sep 2021
Last modified
8 Jul 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-400
Also known as
GHSA-p5w8-wqhj-9hhfPYSEC-2021-333
Sources
NVDJSONOSV GHSA-p5w8-wqhj-9hhfJSONOSV PYSEC-2021-333JSON

Scores

SourceScored byVersionScoreVector / decision
OSV GitHub CVSS 4.0 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
OSV GitHub CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD nvd@nist.gov (Primary) CVSS 2.0 MEDIUM 5.0 AV:N/AC:L/Au:N/C:N/I:N/A:P

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD sqlparse_project sqlparse
cpe:2.3:a:sqlparse_project:sqlparse:*:*:*:*:*:*:*:*
>= 0.4.0, < 0.4.2 0.4.2
OSV PyPI sqlparse >= 0.4.0, < 0.4.2 0.4.2

References

History

  • 25 Nov 2026 20:33 UTC · NVD: first stored (published 20 Sep 2021)
  • 25 Nov 2026 20:12 UTC · OSV: first stored (published 20 Sep 2021)
  • 25 Nov 2026 20:12 UTC · OSV: first stored (published 10 Sep 2021)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.