HighGHSA-4wf5-vphf-c2xcCVE-2022-25858
Terser insecure use of regular expressions leads to ReDoS
Published 16 Jul 2022 · Updated 14 Jan 2025
Affected packages
tersernpm
- Affected
- <4.8.1
- Fixed in
- 4.8.1
Update to the fixed version for your release line, for example:
npm install terser@4.8.1tersernpm
- Affected
- >=5.0.0 <5.14.2
- Fixed in
- 5.14.2
Update to the fixed version for your release line, for example:
npm install terser@5.14.2Details
The package terser before 4.8.1, from 5.0.0 and before 5.14.2 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure usage of regular expressions.
Is GHSA-4wf5-vphf-c2xc in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected terser, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-25858
- Linkgithub.com/terser/terser/commit/a4da7349fdc92c05094f41d33d06d8cd4e90e76b
- Linkgithub.com/terser/terser/commit/d8cc5691be980d663c29cc4d5ce67e852d597012
- Packagegithub.com/terser/terser
- Linkgithub.com/terser/terser/blob/master/lib/compress/evaluate.js%23L135
- Linksnyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2949722
- Linksnyk.io/vuln/SNYK-JS-TERSER-2806366
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.