Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. sanitize-html
  4. ›
  5. CVE-2022-25887

CVE-2022-25887: Inefficient Regular Expression Complexity

August 30, 2022 (updated August 8, 2023)

The package sanitize-html before 2.7.1 is vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure global regular expression replacement logic of HTML comment removal.

References

  • github.com/apostrophecms/sanitize-html/commit/b4682c12fd30e12e82fa2d9b766de91d7d2cd23c
  • github.com/apostrophecms/sanitize-html/pull/557
  • nvd.nist.gov/vuln/detail/CVE-2022-25887
  • security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3008102
  • security.snyk.io/vuln/SNYK-JS-SANITIZEHTML-2957526

Code Behaviors & Features

Detect and mitigate CVE-2022-25887 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 2.7.1

Fixed versions

  • 2.7.1

Solution

Upgrade to version 2.7.1 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/sanitize-html/CVE-2022-25887.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:19 +0000.