Bug 1893298 (CVE-2020-7760)

Summary: CVE-2020-7760 codemirror: ReDoS in tokenBase function in javascript.js
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abenaiss, adam.kaplan, aos-bugs, bmontgom, cmeyers, eparis, extras-orphan, gblomqui, gmainwar, java-sig-commits, jburrell, jokerman, mabashia, mcooper, mizdebsk, moceap, msrb, notting, nstielau, pbhattac, rpetrell, smcdonal, sponnaga, vbobade, viktor.vix.jancik, wzheng
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: codemirror 5.58.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-09 20:21:17 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: 1893301, 1893300    
Bug Blocks: 1893302    

Description Guilherme de Almeida Suckevicz 2020-10-30 16:46:17 UTC
This affects the package codemirror between versions 5.32.0 to 5.58.1 inclusive; the package org.apache.marmotta.webjars:codemirror before 5.58.2.
 The vulnerable regular expression is located in https://github.com/codemirror/CodeMirror/blob/cdb228ac736369c685865b122b736cd0d397836c/mode/javascript/javascript.js#L129. The ReDOS vulnerability of the regex is mainly due to the sub-pattern (s|/*.*?*/)*

Reference:
https://snyk.io/vuln/SNYK-JS-CODEMIRROR-1016937

Upstream patch:
https://github.com/codemirror/CodeMirror/commit/55d0333907117c9231ffdf555ae8824705993bbb

Comment 1 Guilherme de Almeida Suckevicz 2020-10-30 16:46:58 UTC
Created nodejs-codemirror tracking bugs for this issue:

Affects: epel-all [bug 1893301]
Affects: fedora-all [bug 1893300]

Comment 2 Mark Cooper 2020-11-02 01:36:58 UTC
External References:

https://snyk.io/vuln/SNYK-JS-CODEMIRROR-1016937

Comment 6 Product Security DevOps Team 2020-11-09 20:21:17 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-2020-7760