Bug 1954150 (CVE-2021-23382)

Summary: CVE-2021-23382 nodejs-postcss: ReDoS via getAnnotationURL() and loadAnnotation() in lib/previous-map.js
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: alegrand, anpicker, aos-bugs, bcoca, bdettelb, bmontgom, chousekn, cmeyers, davidn, eparis, erooth, gblomqui, gghezzo, gparvin, jburrell, jcammara, jcantril, jhadvig, jhardy, jobarker, jokerman, jramanat, jweiser, jwendell, kakkoyun, kaycoth, kconner, lcosic, mabashia, notting, nstielau, osapryki, pkrupa, rcernich, relrod, rfreiman, rpetrell, sdoran, smcdonal, sponnaga, stcannon, surbania, thee, tkuratom, tomckay, twalsh, vmugicag
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: postcss 8.2.13 Doc Type: If docs needed, set a value
Doc Text:
A regular expression denial of service (ReDoS) vulnerability was found in the npm library `postcss` when using getAnnotationURL() or loadAnnotation() options in lib/previous-map.js. An attacker can use this vulnerability to potentially craft a malicious CSS to process resulting in a denial of service.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-28 01:07:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1949771, 1949772, 1955219, 1955220, 1955222, 1955224, 1956844, 1956845, 1956846, 1956847, 1956848, 1956849, 1962020, 1962021, 1962022, 1962023, 1962024, 1962025, 1984059    
Bug Blocks: 1954151    

Description Guilherme de Almeida Suckevicz 2021-04-27 16:57:56 UTC
The package postcss before 8.2.13 are vulnerable to Regular Expression Denial of Service (ReDoS) via getAnnotationURL() and loadAnnotation() in lib/previous-map.js. The vulnerable regexes are caused mainly by the sub-pattern \/\*\s* sourceMappingURL=(.*).

Reference:
https://snyk.io/vuln/SNYK-JS-POSTCSS-1255640

Upstream patch:
https://github.com/postcss/postcss/commit/2b1d04c867995e55124e0a165b7c6622c1735956

Comment 1 Przemyslaw Roguski 2021-04-29 16:49:57 UTC
Upstream PR:
https://github.com/postcss/postcss/pull/1567

Comment 2 Przemyslaw Roguski 2021-04-29 16:50:01 UTC
External References:

https://snyk.io/vuln/SNYK-JS-POSTCSS-1255640

Comment 8 Przemyslaw Roguski 2021-05-07 08:59:08 UTC
Statement:

In Red Hat OpenShift Container Platform (RHOCP), OpenShift ServiceMesh (OSSM) and Red Hat Advanced Cluster Management for Kubernetes (RHACM) the affected containers are behind OpenShift OAuth authentication. This restricts access to the vulnerable nodejs-postcss library to authenticated users only, therefore the impact is low.

Red Hat OpenShift Container Platform 4 delivers the kibana package where the nodejs-postcss library is used, but due to the code changing to the container first content the kibana package is marked as wontfix. This may be fixed in the future.

In Red Had Quay , whilst a vulnerable version of `postcss` is included in the quay-rhel8 container it is a development dependency only, therefor the impact is low.

Comment 10 Tapas Jena 2021-05-10 18:58:45 UTC
Analysis is complete for AAP 1.2 and as a result, I found that none of the AAP components do use the concerned vulnerable functions i.e. getAnnotationURL() and loadAnnotation(). Hence, marking this as "Not Affected" for AAP.

Comment 15 errata-xmlrpc 2021-07-27 22:32:16 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.8

Via RHSA-2021:2438 https://access.redhat.com/errata/RHSA-2021:2438

Comment 16 Product Security DevOps Team 2021-07-28 01:07:29 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2021-23382

Comment 17 errata-xmlrpc 2021-08-06 00:51:04 UTC
This issue has been addressed in the following products:

  Red Hat Advanced Cluster Management for Kubernetes 2.3 for RHEL 7
  Red Hat Advanced Cluster Management for Kubernetes 2.3 for RHEL 8

Via RHSA-2021:3016 https://access.redhat.com/errata/RHSA-2021:3016

Comment 18 errata-xmlrpc 2021-10-19 12:11:09 UTC
This issue has been addressed in the following products:

  Red Hat Quay 3

Via RHSA-2021:3917 https://access.redhat.com/errata/RHSA-2021:3917