Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. terser
  4. ›
  5. CVE-2022-25858

CVE-2022-25858: Regular Expression Denial of Service (ReDoS)

July 15, 2022 (updated August 8, 2023)

The package terser before 4.8.1, from 5.0.0 and before 5.14.2 is vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure usage of regular expressions.

References

  • github.com/terser/terser/blob/master/lib/compress/evaluate.js%23L135
  • github.com/terser/terser/commit/a4da7349fdc92c05094f41d33d06d8cd4e90e76b
  • github.com/terser/terser/commit/d8cc5691be980d663c29cc4d5ce67e852d597012
  • nvd.nist.gov/vuln/detail/CVE-2022-25858
  • snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2949722
  • snyk.io/vuln/SNYK-JS-TERSER-2806366

Code Behaviors & Features

Detect and mitigate CVE-2022-25858 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.8.1, all versions starting from 5.0.0 before 5.14.2

Fixed versions

  • 4.8.1
  • 5.14.2

Solution

Upgrade to versions 4.8.1, 5.14.2 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity

Source file

npm/terser/CVE-2022-25858.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:46 +0000.