CVE-2022-25858
HIGH 7.5CVSS 3.1Terser insecure use of regular expressions leads to ReDoS
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.
- Published
- 15 Jul 2022
- Last modified
- 17 Jun 2026
- Assigned by
- report@snyk.io
- NVD status
- Modified
- Weakness
- CWE-1333
- Also known as
- GHSA-4wf5-vphf-c2xc
- Sources
- NVDJSONOSV GHSA-4wf5-vphf-c2xcJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | terser | tersercpe:2.3:a:terser:terser:*:*:*:*:*:node.js:*:* |
< 4.8.1 | 4.8.1 |
| NVD | terser | tersercpe:2.3:a:terser:terser:*:*:*:*:*:node.js:*:* |
>= 5.0.0, < 5.14.2 | 5.14.2 |
| OSV | npm | terser | < 4.8.1 | 4.8.1 |
| OSV | npm | terser | >= 5.0.0, < 5.14.2 | 5.14.2 |
References
- https://github.com/terser/terser/blob/master/lib/compress/evaluate.js%23L135 · Broken Link, WEB
- https://github.com/terser/terser/commit/a4da7349fdc92c05094f41d33d06d8cd4e90e76b · Patch, Third Party Advisory, WEB
- https://github.com/terser/terser/commit/d8cc5691be980d663c29cc4d5ce67e852d597012 · Patch, Third Party Advisory, WEB
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2949722 · Exploit, Patch, Third Party Advisory, WEB
- https://snyk.io/vuln/SNYK-JS-TERSER-2806366 · Exploit, Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-25858 · ADVISORY
- https://github.com/terser/terser · PACKAGE
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 15 Jul 2022)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 16 Jul 2022)