Vulnerability Name:

CVE-2021-32839 (CCN-209811)

Assigned:2021-09-10
Published:2021-09-10
Updated:2021-09-29
Summary: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 v3 Severity:7.5 High (CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
6.5 Medium (Temporal CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Network
Attack Complexity (AC): Low
Privileges Required (PR): None
User Interaction (UI): None
Scope:Scope (S): Unchanged
Impact Metrics:Confidentiality (C): None
Integrity (I): None
Availibility (A): High
5.3 Medium (CCN CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L)
4.6 Medium (CCN Temporal CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Network
Attack Complexity (AC): Low
Privileges Required (PR): None
User Interaction (UI): None
Scope:Scope (S): Unchanged
Impact Metrics:Confidentiality (C): None
Integrity (I): None
Availibility (A): Low
CVSS v2 Severity:5.0 Medium (CVSS v2 Vector: AV:N/AC:L/Au:N/C:N/I:N/A:P)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): Low
Authentication (Au): None
Impact Metrics:Confidentiality (C): None
Integrity (I): None
Availibility (A): Partial
5.0 Medium (CCN CVSS v2 Vector: AV:N/AC:L/Au:N/C:N/I:N/A:P)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): Low
Athentication (Au): None
Impact Metrics:Confidentiality (C): None
Integrity (I): None
Availibility (A): Partial
Vulnerability Type:CWE-400
Vulnerability Consequences:Denial of Service
References:Source: MITRE
Type: CNA
CVE-2021-32839

Source: XF
Type: UNKNOWN
sqlparse-cve202132839-dos(209811)

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/andialbrecht/sqlparse/commit/8238a9e450ed1524e40cb3a8b0b3c00606903aeb

Source: CCN
Type: sqlparse GIT Repository
StripComments filter contains a regular expression that is vulnerable to ReDOS (Regular Expression Denial of Service)

Source: CONFIRM
Type: Third Party Advisory
https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-p5w8-wqhj-9hhf

Source: CCN
Type: WhiteSource Vulnerability Database
CVE-2021-32839

Source: CCN
Type: WhiteSource Vulnerability Database
WS-2021-0369

Vulnerable Configuration:Configuration 1:
  • cpe:/a:sqlparse_project:sqlparse:*:*:*:*:*:*:*:* (Version >= 0.4.0 and < 0.4.2)

  • * Denotes that component is vulnerable
    Oval Definitions
    Definition IDClassTitleLast Modified
    oval:org.opensuse.security:def:7786
    P
    python3-sqlparse-0.4.2-3.3.1 on GA media (Moderate)
    2023-06-12
    oval:org.opensuse.security:def:3717
    P
    Security update for php7 (Important)
    2022-07-06
    oval:org.opensuse.security:def:3183
    P
    libhivex0-1.3.10-4.1 on GA media (Moderate)
    2022-06-28
    oval:org.opensuse.security:def:94813
    P
    python3-sqlparse-0.4.2-3.3.1 on GA media (Moderate)
    2022-06-22
    oval:org.opensuse.security:def:113303
    P
    python36-sqlparse-0.4.2-1.1 on GA media (Moderate)
    2022-01-17
    oval:org.opensuse.security:def:111809
    P
    Security update for python-sqlparse (Moderate)
    2021-12-01
    oval:org.opensuse.security:def:64806
    P
    Security update for python-sqlparse (Moderate)
    2021-12-01
    oval:org.opensuse.security:def:101547
    P
    Security update for python-sqlparse (Moderate)
    2021-12-01
    oval:org.opensuse.security:def:816
    P
    Security update for python-sqlparse (Moderate)
    2021-12-01
    oval:org.opensuse.security:def:73928
    P
    Security update for python-sqlparse (Moderate)
    2021-12-01
    BACK
    sqlparse_project sqlparse *