Regular expression denial of service in codemirrorGHSA-4gw3-8f77-f72c
MEDIUMFix: codemirror/CodeMirror@55d0333GHSA-4gw3-8f77-f72c is a medium-severity (CVSS 5.3) Uncontrolled Resource Consumption vulnerability in codemirror. 7 public exploit references exist, so weaponization risk is real. A fix is available for codemirror — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-4gw3-8f77-f72c by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
codemirrornpmDescription
This affects the package codemirror before 5.58.2; 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.jsL129. The ReDOS vulnerability of the regex is mainly due to the sub-pattern (s|/.?/)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | codemirror | all versions | 5.58.2npm install codemirror@5.58.2 |
Affected Products
codemirrorcodemirrorapplication expressoracleenterprise manager express user interfaceoracleessbaseoraclehyperion data relationship managementoraclespatial studiooracleResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
This affects the package codemirror before 5.58.2; the package org.apach…
This affects the package codemirror before 5.58.2; the package org.apach…
This affects the package codemirror before 5.58.2; the package org.apach…
This affects the package codemirror before 5.58.2; the package org.apach…
This affects the package codemirror before 5.58.2; the package org.apach…
This affects the package codemirror before 5.58.2; the package org.apach…
This affects the package codemirror before 5.58.2; the package org.apach…
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for codemirror, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update codemirror to 5.58.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4gw3-8f77-f72c is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is GHSA-4gw3-8f77-f72c in your dependencies?
Find it across npm, including transitive dependencies.