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

Medium 5.3 Published Updated

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.

PackageAffectedFixed in
sanitize-html npmAll versions2.7.1
sanitize-html npmAll versions2.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.

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.

Is CVE-2022-25887 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free