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

Published Aug 30, 2022
·
Updated

A flaw was found in sanitize-html library. Insecure global regular expression replacement logic of HTML comment removal could lead to a regular expression Denial of Service (ReDoS), affecting the availability of the affected component.

Other sources

A Regular Expression Denial of Service (ReDoS) due to insecure global regular expression replacement logic of HTML comment removal.

Reference:

https://security.snyk.io/vuln/SNYK-JS-SANITIZEHTML-2957526 https://github.com/apostrophecms/sanitize-html/pull/557 https://github.com/apostrophecms/sanitize-html/commit/b4682c12fd30e12e82fa2d9b766de91d7d2cd23c

Red Hat

Node.js sanitize-html module is vulnerable to a denial of service, caused by insecure global regular expression replacement logic of HTML comment removal. By sending a specially-crafted request, a remote attacker could exploit this vulnerability to cause a Regular Expression Denial of Service (ReDoS).

IBM

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

Affected Software

7 affected componentsFixes available
redhat/sanitize-html<2.7.1
2.7.1
npm/sanitize-html<2.7.1
2.7.1
IBM Cloud Pak for Business Automation<=V22.0.2
IBM Cloud Pak for Business Automation<=V21.0.3 - V21.0.3-IF016
IBM Cloud Pak for Business Automation<=V22.0.1 - V22.0.1-IF006 and later fixes V21.0.2 - V21.0.2-IF012 and later fixesV21.0.1 - V21.0.1-IF007 and later fixesV20.0.1 - V20.0.3 and later fixesV19.0.1 - V19.0.3 and later fixesV18.0.0 - V18.0.2 and later fixes
apostrophecms Sanitize-html Node.js<2.7.1
debian/node-sanitize-html
2.8.0+~2.6.2-12.14.0+~2.13.0-1

Event History

Aug 30, 2022
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·05:00 AM
Data Sourced
via MITRE·05:00 AM
DescriptionSeverityWeakness
Aug 31, 2022
Advisory Published
via GitHub·12:00 AM
Apr 28, 2025
Data Sourced
via Ubuntu·05:08 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·05:09 AM
Description

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the vulnerability ID for this issue?

The vulnerability ID for this issue is CVE-2022-25887.

2

What is the severity of CVE-2022-25887?

The severity of CVE-2022-25887 is high with a CVSS score of 7.5.

3

Which software packages are affected by CVE-2022-25887?

The sanitize-html package before version 2.7.1 is affected by CVE-2022-25887.

4

What is the impact of CVE-2022-25887?

CVE-2022-25887 can be exploited by a remote attacker to cause a Regular Expression Denial of Service (ReDoS).

5

How can I fix CVE-2022-25887?

To fix CVE-2022-25887, update the sanitize-html package to version 2.7.1 or later.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203