Vulnerability · Published Aug 30, 2022 · Assigned by snyk
CVE-2022-25887Regular Expression Denial of Service (ReDoS)
Medium 5.3
In plain English
A medium-severity security flaw in sanitize-html. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.6% (higher than 75% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)1.6%top 24.8% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-sanitize-html | 2.7.1+~2.6.2-1 | DEBIAN-CVE-2022-25887 |
| Debian:13 | node-sanitize-html | 2.7.1+~2.6.2-1 | DEBIAN-CVE-2022-25887 |
| Debian:14 | node-sanitize-html | 2.7.1+~2.6.2-1 | DEBIAN-CVE-2022-25887 |
| Ubuntu:25.10 | jupyter-notebook | no fix listed | UBUNTU-CVE-2022-25887 |
| Ubuntu:26.10 | jupyter-notebook | no fix listed | UBUNTU-CVE-2022-25887 |
| Ubuntu:22.04:LTS | node-sanitize-html | no fix listed | UBUNTU-CVE-2022-25887 |
| Ubuntu:24.04:LTS | node-sanitize-html | no fix listed | UBUNTU-CVE-2022-25887 |
| Ubuntu:25.10 | node-sanitize-html | no fix listed | UBUNTU-CVE-2022-25887 |
| Ubuntu:26.04:LTS | node-sanitize-html | no fix listed | UBUNTU-CVE-2022-25887 |
| Ubuntu:26.10 | node-sanitize-html | no fix listed | UBUNTU-CVE-2022-25887 |
| npm | sanitize-html | 2.7.1 | GHSA-cgfm-xwp7-2cvr |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | sanitize-html | unspecified – before 2.7.1 |
References
- https://security.snyk.io/vuln/SNYK-JS-SANITIZEHTML-2957526 x_refsource_MISC
- https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3008102 x_refsource_MISC
- https://github.com/apostrophecms/sanitize-html/pull/557 x_refsource_MISC
- https://github.com/apostrophecms/sanitize-html/commit/b4682c12fd30e12e82fa2d9b766de91d7d2cd23c x_refsource_MISC