Every CVE Search/ Get API key

CVE-2022-25887

Regular Expression Denial of Service (ReDoS)

5.3 MediumFix available

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

1.55%Up 0.6 points since Aug 30, 2022
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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 HighCVSS: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 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS 3.1
7.5 HighCVSS: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 MediumCVSS: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 HighCVSS: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 HighCVSS: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 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS 3.1
7.5 HighCVSS: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

Affected packages
PackageAffectedFixed
sanitize-html
npm
before 2.7.1
2.7.1
sanitize-html
TuxCare: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-html
Debian:12
before 2.7.1+~2.6.2-1
2.7.1+~2.6.2-1
node-sanitize-html
Debian:13
before 2.7.1+~2.6.2-1
2.7.1+~2.6.2-1
node-sanitize-html
Debian:14
before 2.7.1+~2.6.2-1
2.7.1+~2.6.2-1
@rootio/sanitize-html
Root: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-html
Root:npm
before 1.4.2-aikido.9
1.4.2-aikido.9
node-sanitize-html
Ubuntu:22.04:LTS
All versions, plus listed versions
2.6.1-1
None known
jupyter-notebook
Ubuntu: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-html
Ubuntu:24.04:LTS
All versions, plus listed versions
2.8.0+~2.6.2-1
None known
Show 6 moreShow less
Affected packages
PackageAffectedFixed
jupyter-notebook
Ubuntu: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-notebook
Ubuntu:25.10
All versions, plus listed versions
6.4.13-56.4.13-5ubuntu0.1
None known
node-sanitize-html
Ubuntu:25.10
All versions, plus listed versions
2.14.0+~2.13.0-1
None known
jupyter-notebook
Ubuntu:26.10
All versions, plus listed versions
6.4.13-5ubuntu0.1
None known
node-sanitize-html
Ubuntu:26.10
All versions, plus listed versions
2.14.0+~2.13.0-12.17.0+~2.16.1-1
None known
node-sanitize-html
Ubuntu:26.04:LTS
All versions, plus listed versions
2.14.0+~2.13.0-1
None known

History

History
RecordedChangedSources
affected, factsOSV
aliases, publishedEUVD
first indexedCVE 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

Show 5 moreShow less
MoveEnter Open