CVE-2022-25887
Regular Expression Denial of Service (ReDoS)
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.3
Regular Expression Denial of Service (ReDoS)
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.
- Record
CVE-2022-25887- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
EUVDEUVD-2022-6537
5.3
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.
- Record
EUVD-2022-6537- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-cgfm-xwp7-2cvr
7.5
Sanitize-html Vulnerable To REDoS Attacks
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.
- Record
GHSA-cgfm-xwp7-2cvr- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2022-25887- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
OSV
5.3
Regular Expression Denial of Service (ReDoS)
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.
- Record
CVE-2022-25887- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
OSVDEBIAN-CVE-2022-25887
7.5
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.
- Record
DEBIAN-CVE-2022-25887- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-03
Show 5 moreShow less
OSVGHSA-cgfm-xwp7-2cvr
7.5
Sanitize-html Vulnerable To REDoS Attacks
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.
- Record
GHSA-cgfm-xwp7-2cvr- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2022-25887
5.3
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.
- Record
UBUNTU-CVE-2022-25887- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-04
OSVCLSA-2026-1776645373 No score
TuxCare security update for sanitize-html (1 CVE)
TuxCare rebuilt sanitize-html to address 1 CVE. Fixed in 1.27.5-tuxcare.3.
- Record
CLSA-2026-1776645373- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2022-25887 No score
CVE-2022-25887 in @rootio/sanitize-html - Patched by Root
Root has patched CVE-2022-25887 in the @rootio/sanitize-html package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2022-25887- Updated
- 2026-11-02
OSVUSN-7464-1 No score
jupyter-notebook vulnerability
It was discovered that Jupyter Notebook did not properly parse HTML comments under certain circumstances. An attacker could possibly use this issue to cause a regular expression denial of service (ReDoS).
- Record
USN-7464-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
sanitize-htmlnpm |
before 2.7.1 | 2.7.1 |
sanitize-htmlTuxCare:npm |
1.27.5-tuxcare.0 up to 1.27.5-tuxcare.3, plus listed versions 1.27.51.27.5-tuxcare.11.27.5-tuxcare.2 |
1.27.5-tuxcare.3 |
node-sanitize-htmlDebian:12 |
before 2.7.1+~2.6.2-1 | 2.7.1+~2.6.2-1 |
node-sanitize-htmlDebian:13 |
before 2.7.1+~2.6.2-1 | 2.7.1+~2.6.2-1 |
node-sanitize-htmlDebian:14 |
before 2.7.1+~2.6.2-1 | 2.7.1+~2.6.2-1 |
@rootio/sanitize-htmlRoot:npm |
before 1.4.2-root.io.1 | 1.4.2-root.io.11.4.2-root.io.21.4.2-root.io.31.4.2-root.io.41.4.2-root.io.51.4.2-root.io.61.4.2-root.io.71.4.2-root.io.81.4.2-root.io.9 |
sanitize-htmlRoot:npm |
before 1.4.2-aikido.9 | 1.4.2-aikido.9 |
node-sanitize-htmlUbuntu:22.04:LTS |
All versions, plus listed versions 2.6.1-1 |
None known |
jupyter-notebookUbuntu:Pro:22.04:LTS |
before 6.4.8-1ubuntu0.1+esm1, plus listed versions 6.2.0-16.4.5-26.4.5-36.4.5-46.4.8-16.4.8-1ubuntu0.1 |
6.4.8-1ubuntu0.1+esm1 |
node-sanitize-htmlUbuntu:24.04:LTS |
All versions, plus listed versions 2.8.0+~2.6.2-1 |
None known |
Show 6 moreShow less
| Package | Affected | Fixed |
|---|---|---|
jupyter-notebookUbuntu:Pro:24.04:LTS |
before 6.4.12-2.2ubuntu1+esm1, plus listed versions 6.4.12-2.26.4.12-2.2ubuntu1 |
6.4.12-2.2ubuntu1+esm1 |
jupyter-notebookUbuntu:25.10 |
All versions, plus listed versions 6.4.13-56.4.13-5ubuntu0.1 |
None known |
node-sanitize-htmlUbuntu:25.10 |
All versions, plus listed versions 2.14.0+~2.13.0-1 |
None known |
jupyter-notebookUbuntu:26.10 |
All versions, plus listed versions 6.4.13-5ubuntu0.1 |
None known |
node-sanitize-htmlUbuntu:26.10 |
All versions, plus listed versions 2.14.0+~2.13.0-12.17.0+~2.16.1-1 |
None known |
node-sanitize-htmlUbuntu:26.04:LTS |
All versions, plus listed versions 2.14.0+~2.13.0-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-25887 is a medium vulnerability (CVSS 5.3) in Apostrophecms Sanitize-html, published August 30, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.55%, the 75th percentile. Fixed in sanitize-html 2.7.1.
References
security.snyk.io/vuln/SNYK-JS-SANITIZEHTML-2957526
security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3008102
github.com/apostrophecms/sanitize-html/pull/557
github.com/apostrophecms/sanitize-html/commit/b4682c12fd30e12e82fa2d9b766de91d7d2cd23c
nvd.nist.gov/vuln/detail/CVE-2022-25887
github.com/advisories/GHSA-cgfm-xwp7-2cvr