DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode
DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Starting in version 1.0.10 and prior to version 3.4.0, `SAFE_FOR_TEMPLATES` strips `{{...}}` expressions from untrusted HTML. This works in string mode but not with `RETURN_DOM` or `RETURN_DOM_FRAGMENT`, allowing XSS via template-evaluating frameworks like Vue 2. Version 3.4.0 patches the issue.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-41239
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 04:00 UTC · Revision 1
Source evidence
DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode
core-osv · Original sourcePublished 23 Apr 2026, 14:47 UTC
DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Starting in version 1.0.10 and prior to version 3.4.0, `SAFE_FOR_TEMPLATES` strips `{{...}}` expressions from untrusted HTML. This works in string mode but not with `RETURN_DOM` or `RETURN_DOM_FRAGMENT`, allowing XSS via template-evaluating frameworks like Vue 2. Version 3.4.0 patches the issue.
osv:CVE-2026-41239
Complete source record
{
"id": "70dccaa7bb14a78df9e02b6e876c27baf89e86b96cc820b1da17c3b4d77a7138",
"url": "https://osv.dev/vulnerability/CVE-2026-41239",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode",
"summary": "DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Starting in version 1.0.10 and prior to version 3.4.0, `SAFE_FOR_TEMPLATES` strips `{{...}}` expressions from untrusted HTML. This works in string mode but not with `RETURN_DOM` or `RETURN_DOM_FRAGMENT`, allowing XSS via template-evaluating frameworks like Vue 2. Version 3.4.0 patches the issue.",
"evidence": "osv:CVE-2026-41239",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-41239",
"aliases": [
"CVE-2026-41239",
"GHSA-crv5-9vww-q3g8"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/cure53/dompurify",
"type": "GIT",
"events": [
{
"introduced": "b537cab466329b1b077e0e5e3c14edad2b7142f7"
},
{
"fixed": "5b16e0b892e82b1779d62b9928b43c4c4ff290b9"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "1.0.10"
},
{
"fixed": "3.4.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"range": [
{
"fixed": "5b16e0b892e82b1779d62b9928b43c4c4ff290b9"
}
],
"source": "REFERENCES_TAG",
"original_tag": "3.4.0"
}
]
}
}
],
"versions": [
"3.3.3",
"3.2.3",
"3.1.3",
"3.0.4",
"2.4.3",
"2.4.2",
"2.4.1",
"2.4.0",
"2.3.12",
"2.3.11",
"2.3.10",
"2.3.9",
"2.3.8",
"2.3.6",
"2.3.5",
"2.3.4",
"2.3.3",
"2.3.2",
"2.3.1",
"2.3.0",
"2.2.9",
"2.2.8",
"2.2.7",
"2.2.6",
"2.2.4",
"2.2.3",
"2.2.2",
"2.2.0",
"2.1.1",
"2.1.0",
"2.0.17",
"2.0.16",
"2.0.15",
"2.0.14",
"2.0.13",
"2.0.12",
"2.0.11",
"2.0.10",
"2.0.9",
"2.0.8",
"2.0.6",
"2.0.5",
"2.0.4",
"2.0.3",
"2.0.2",
"2.0.1",
"2.0.0",
"1.0.11",
"1.0.10"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-41239.json"
}
}
],
"modified": "2026-10-28T02:30:49.402047743Z",
"provider": "osv",
"references": [
"https://github.com/cure53/DOMPurify/releases/tag/3.4.0",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41239.json",
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-crv5-9vww-q3g8",
"https://nvd.nist.gov/vuln/detail/CVE-2026-41239"
],
"provider_metadata": {
"cwe_ids": [
"CWE-1289",
"CWE-79"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41239.json"
}
},
"related_cves": [
{
"value": "CVE-2026-41239",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 517956,
"published_at": "2026-04-23T14:47:56.129+00:00"
}