CVE-2022-25887: Sanitize-html Vulnerable To REDoS Attacks
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.15664%
CWE
Published
8/31/2022
Updated
4/22/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| sanitize-html | npm | < 2.7.1 | 2.7.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability was specifically patched by replacing a regex-based comment removal approach with manual string operations in index.js. The commit diff shows the vulnerable regex pattern was used in href sanitization within the main sanitizeHtml() function. The CWE-1333 classification and advisory descriptions confirm this was a regex efficiency issue in comment handling, making the sanitizeHtml() function's comment removal logic the clear vulnerable point.