Medium
Regular Expression Denial of Service (ReDoS)
Type: advisorySources: OSV
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2022-25887
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 15:57 UTC · Revision 1
Source evidence
Regular Expression Denial of Service (ReDoS)
core-osv · Original sourcePublished 30 Aug 2022, 05:00 UTC
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.
osv:CVE-2022-25887
Complete source record
{
"id": "5eee7850ab8b152a4edd3eb209b57b227e382387d0646f53193b97455ccb6876",
"url": "https://osv.dev/vulnerability/CVE-2022-25887",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Regular Expression Denial of Service (ReDoS)",
"summary": "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.",
"evidence": "osv:CVE-2022-25887",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2022-25887",
"aliases": [
"CVE-2022-25887",
"GHSA-cgfm-xwp7-2cvr"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/apostrophecms/apostrophe",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "b4682c12fd30e12e82fa2d9b766de91d7d2cd23c"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:apostrophecms:sanitize-html:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "2.7.1"
}
],
"source": "CPE_RANGE"
}
]
}
},
{
"repo": "https://github.com/apostrophecms/sanitize-html",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "b4682c12fd30e12e82fa2d9b766de91d7d2cd23c"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "2.7.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "SplitRange"
},
{
"range": [
{
"fixed": "b4682c12fd30e12e82fa2d9b766de91d7d2cd23c"
}
],
"source": "REFERENCES_COMMIT"
},
{
"cpe": "cpe:2.3:a:apostrophecms:sanitize-html:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "2.7.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"2.5.3",
"2.3.3",
"1.27.4",
"1.22.0",
"1.21.1",
"1.21.0",
"1.20.0",
"1.19.3",
"1.19.2",
"1.19.1",
"1.19.0",
"1.18.5",
"1.18.4",
"1.18.3",
"1.18.2",
"1.11.4",
"1.11.1",
"1.11.0",
"1.10.1",
"v1.9.0",
"v1.8.0",
"v1.7.2",
"v1.7.1",
"v1.7.0",
"v1.5.2",
"2.7.0",
"2.6.1",
"2.6.0",
"2.5.2",
"2.5.1",
"2.5.0",
"2.4.0",
"2.3.2",
"2.3.1",
"2.3.0",
"2.2.0",
"2.1.2",
"2.1.1",
"2.1.0",
"2.0.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-25887.json"
}
}
],
"modified": "2026-10-28T02:30:36.903888673Z",
"provider": "osv",
"references": [
"https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3008102",
"https://security.snyk.io/vuln/SNYK-JS-SANITIZEHTML-2957526",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/25xxx/CVE-2022-25887.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-25887",
"https://github.com/apostrophecms/sanitize-html/commit/b4682c12fd30e12e82fa2d9b766de91d7d2cd23c",
"https://github.com/apostrophecms/sanitize-html/pull/557"
],
"provider_metadata": {
"cna_assigner": "snyk",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/25xxx/CVE-2022-25887.json"
}
},
"related_cves": [
{
"value": "CVE-2022-25887",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504370,
"published_at": "2022-08-30T05:00:20.149+00:00"
}