CVE-2022-25887 Regular Expression Denial of Service (ReDoS)
An attacker can cause a denial of service in applications using sanitize-html by exploiting insecure regular expression logic during HTML comment removal.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-25887?
CVE-2022-25887 is a medium-severity denial of service vulnerability in sanitize-html, published on 30 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-1333
Which versions are affected by CVE-2022-25887?
2 open source packages ship an affected version, including sanitize-html. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
sanitize-html npm | All versions | 2.7.1 |
sanitize-html npm | All versions | 2.7.1 |
Products include Apostrophecms Sanitize-Html.
How do I fix CVE-2022-25887?
Upgrade sanitize-html to 2.7.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2022-25887 being exploited?
There is no known exploitation of CVE-2022-25887 in the wild and no public exploit code.
Other vulnerabilities in sanitize-html
- CVE-2014-125128 Cross-site scripting in apostrophecms:sanitize-html
- CVE-2019-25225 sanitize-html is vulnerable to XSS through incomprehensive sanitization
- CVE-2016-1000237 Cross-Site Scripting in sanitize-html
- CVE-2024-21501 sanitize-html Information Exposure vulnerability
- CVE-2021-26539 Improper Input Validation in sanitize-html
Sources
Also known as CLSA-2026-1776645373, DEBIAN-CVE-2022-25887, GHSA-cgfm-xwp7-2cvr, ROOT-APP-NPM-CVE-2022-25887, UBUNTU-CVE-2022-25887, USN-7464-1.