DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml
### Summary DOMPurify drops `attributeName` attributes whose value contains `href`, so an allowed `` or `` can't rewrite a link's href after sanitizing. The check compares the attribute name after `transformCaseFunc`, and that function doesn't lowercase in XHTML mode. In XHTML the attribute is spelled `attributeName`, so the comparison with `"attributename"` never matches and the guard does nothing. An app that uses `PARSER_MEDIA_TYPE: 'application/xhtml+xml'` and allows `animate` and `attributeName` will keep ``. Clicking the parent link then runs the script. This needs a non-default config, so going by SECURITY.md, this is a hardening bug rather than a bypass of the default config. ### Details In `_sanitizeAttributes` (dist/purify.js line 2216 in 3.4.16): ```js const lcName = transformCaseFunc(name); ... if (lcName === "attributename" && stringMatch(value, "href")) { _removeAttribute(name, currentNode, attr); continue; } ``` `transformCaseFunc` is `stringToLowerCase` for text/html but the identity function for application/xhtml+xml, because XML names are case-sensitive. The XML parser keeps SVG's real name `attributeName`, so in XHTML mode `lcName` is `attributeName` and the branch never runs. People using XHTML mode have to list SVG attributes in camelCase. The built-in attribute lists are lowercase and won't match, so `ALLOWED_ATTR`/`ADD_ATTR: ['attributeName', ...]` is the config you'd naturally write here. The value also passes the URI check. `IS_ALLOWED_URI` only check
- Products
- dompurify
- Affected versions
- Not specified
- Fixed versions
- 3.4.17
- CVEs
- CVE-2026-116802
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 17:55 UTC · Revision 1
Source evidence
DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml
core-osv · Original sourcePublished 22 Oct 2026, 16:24 UTC
### Summary DOMPurify drops `attributeName` attributes whose value contains `href`, so an allowed `` or `` can't rewrite a link's href after sanitizing. The check compares the attribute name after `transformCaseFunc`, and that function doesn't lowercase in XHTML mode. In XHTML the attribute is spelled `attributeName`, so the comparison with `"attributename"` never matches and the guard does nothing. An app that uses `PARSER_MEDIA_TYPE: 'application/xhtml+xml'` and allows `animate` and `attributeName` will keep ``. Clicking the parent link then runs the script. This needs a non-default config, so going by SECURITY.md, this is a hardening bug rather than a bypass of the default config. ### Details In `_sanitizeAttributes` (dist/purify.js line 2216 in 3.4.16): ```js const lcName = transformCaseFunc(name); ... if (lcName === "attributename" && stringMatch(value, "href")) { _removeAttribute(name, currentNode, attr); continue; } ``` `transformCaseFunc` is `stringToLowerCase` for text/html but the identity function for application/xhtml+xml, because XML names are case-sensitive. The XML parser keeps SVG's real name `attributeName`, so in XHTML mode `lcName` is `attributeName` and the branch never runs. People using XHTML mode have to list SVG attributes in camelCase. The built-in attribute lists are lowercase and won't match, so `ALLOWED_ATTR`/`ADD_ATTR: ['attributeName', ...]` is the config you'd naturally write here. The value also passes the URI check. `IS_ALLOWED_URI` only check
osv:GHSA-c6gr-qvv4-5v3f
dompurify
Fixed versions: 3.4.17
Complete source record
{
"id": "22573a4e0913204aea40ddea79ecf93033a882fefc51e7cd90239eccd922b570",
"url": "https://osv.dev/vulnerability/GHSA-c6gr-qvv4-5v3f",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml",
"summary": "### Summary DOMPurify drops `attributeName` attributes whose value contains `href`, so an allowed `` or `` can't rewrite a link's href after sanitizing. The check compares the attribute name after `transformCaseFunc`, and that function doesn't lowercase in XHTML mode. In XHTML the attribute is spelled `attributeName`, so the comparison with `\"attributename\"` never matches and the guard does nothing. An app that uses `PARSER_MEDIA_TYPE: 'application/xhtml+xml'` and allows `animate` and `attributeName` will keep ``. Clicking the parent link then runs the script. This needs a non-default config, so going by SECURITY.md, this is a hardening bug rather than a bypass of the default config. ### Details In `_sanitizeAttributes` (dist/purify.js line 2216 in 3.4.16): ```js const lcName = transformCaseFunc(name); ... if (lcName === \"attributename\" && stringMatch(value, \"href\")) { _removeAttribute(name, currentNode, attr); continue; } ``` `transformCaseFunc` is `stringToLowerCase` for text/html but the identity function for application/xhtml+xml, because XML names are case-sensitive. The XML parser keeps SVG's real name `attributeName`, so in XHTML mode `lcName` is `attributeName` and the branch never runs. People using XHTML mode have to list SVG attributes in camelCase. The built-in attribute lists are lowercase and won't match, so `ALLOWED_ATTR`/`ADD_ATTR: ['attributeName', ...]` is the config you'd naturally write here. The value also passes the URI check. `IS_ALLOWED_URI` only check",
"evidence": "osv:GHSA-c6gr-qvv4-5v3f",
"products": [
{
"name": {
"value": "dompurify",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "3.4.17",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "low",
"structured": {
"id": "GHSA-c6gr-qvv4-5v3f",
"aliases": [
"CVE-2026-116802",
"GHSA-c6gr-qvv4-5v3f"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "3.4.17"
}
]
}
],
"package": {
"name": "dompurify",
"purl": "pkg:npm/dompurify",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-c6gr-qvv4-5v3f/GHSA-c6gr-qvv4-5v3f.json",
"last_known_affected_version_range": "<= 3.4.16"
}
}
],
"modified": "2026-10-27T10:56:08.682782458Z",
"provider": "osv",
"references": [
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-c6gr-qvv4-5v3f",
"https://github.com/cure53/DOMPurify/pull/1672",
"https://github.com/cure53/DOMPurify/commit/a77a3e78b59f72fa4d1c83f22e121ad9cc7d3575",
"https://github.com/cure53/DOMPurify",
"https://github.com/cure53/DOMPurify/releases/tag/3.4.17"
],
"provider_metadata": {
"cwe_ids": [
"CWE-79"
],
"severity": "LOW",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2026-10-22T16:24:23Z"
}
},
"related_cves": [
{
"value": "CVE-2026-116802",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/database_specific/severity"
},
"source_id": "core-osv",
"document_id": 461504,
"published_at": "2026-10-22T16:24:23+00:00"
}