Skip to content

Commit db79fa7

Browse files
Auto-update jsrepository: dompurify | GHSA-55q2-fjhq-7xh7 (#614)
Updated libraries (1): dompurify Updated vulnerability IDs (1): GHSA-55q2-fjhq-7xh7 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 680dfa2 commit db79fa7

9 files changed

Lines changed: 36 additions & 9 deletions

repository/jsrepository-master.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5582,7 +5582,10 @@
55825582
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
55835583
"details": "### Summary\n\nDuring `IN_PLACE` sanitization, a hook that removes an element can leave that element's detached descendants executable. A descendant image can retain its attacker-provided `onload` handler and fire after `sanitize()` returns, even though the returned root is clean and the image remains disconnected from the document.\n\n### Details\n\nIn DOMPurify 3.4.12, `_sanitizeElements()` in `src/purify.ts:1862-1904` runs the `beforeSanitizeElements` or `uponSanitizeElement` hook and returns immediately when the hook detached the current node. The return does not call `_neutralizeSubtree(currentNode)`.\n\nThe detached subtree is not added to `DOMPurify.removed`, so the post-walk `IN_PLACE` neutralization cannot reach it. If the browser queued a resource event while the application constructed the detached dirty root, a descendant can therefore retain its handler and execute after sanitization.\n\nThe hook only rejects the containing element and does not add or approve the event handler. DOMPurify's ordinary removal path de-arms the same queued event; only the hook-detachment early return skips the existing subtree neutralization.\n\n### PoC\n\nLoad the published `dompurify@3.4.12` `dist/purify.js` before this script in Chromium:\n\n```html\n<div id=\"result\">not fired</div>\n<script>\nconst root = document.createElement('div');\nroot.innerHTML = `\n <footer>\n <img src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n onload=\"result.textContent = 'XSS after sanitize'\">\n </footer>\n <div>safe</div>`;\n\nDOMPurify.setConfig({\n ALLOWED_TAGS: ['div', '#text', 'footer'],\n IN_PLACE: true\n});\nDOMPurify.addHook('uponSanitizeElement', node => {\n if (node.tagName === 'FOOTER') node.remove();\n});\n\nDOMPurify.sanitize(root);\ndocument.body.append(root);\n</script>\n```\n\n`sanitize()` returns with no handler execution and the returned root contains only the safe `div`. After the event loop advances, the original image remains disconnected but its retained `onload` changes the page to `XSS after sanitize`.\n\nAs the claim-matched control, use the same detached input with `ALLOWED_TAGS: ['div', '#text']` and no hook. DOMPurify's ordinary removal path removes the original image's handler, the returned root is still `<div>safe</div>`, and the marker does not fire.\n\n### Impact\n\nIn an application that uses `IN_PLACE` with the documented element-removal hook pattern, an attacker who can supply HTML can execute JavaScript in the integrating application's origin after the application sanitizes and renders that content.\n\nThe required non-default configuration is `IN_PLACE` plus a hook that removes a containing element. The hook does not add or approve the event handler, and the dirty root never needs to be connected before sanitization.\n\n### Suggested fix\n\nReuse the existing `_neutralizeSubtree(currentNode)` helper before returning from both hook-detachment branches in `_sanitizeElements()`. Add regressions for `beforeSanitizeElements` and `uponSanitizeElement` that retain a reference to a descendant resource element and verify that its event handler is removed after the hook detaches its ancestor.",
55845584
"identifiers": {
5585-
"githubID": "GHSA-55q2-fjhq-7xh7"
5585+
"githubID": "GHSA-55q2-fjhq-7xh7",
5586+
"CVE": [
5587+
"CVE-2026-75838"
5588+
]
55865589
},
55875590
"severity": "medium",
55885591
"cwe": [

repository/jsrepository-v2.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5940,7 +5940,10 @@
59405940
],
59415941
"identifiers": {
59425942
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
5943-
"githubID": "GHSA-55q2-fjhq-7xh7"
5943+
"githubID": "GHSA-55q2-fjhq-7xh7",
5944+
"CVE": [
5945+
"CVE-2026-75838"
5946+
]
59445947
},
59455948
"info": [
59465949
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7",

repository/jsrepository-v3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6037,7 +6037,10 @@
60376037
],
60386038
"identifiers": {
60396039
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
6040-
"githubID": "GHSA-55q2-fjhq-7xh7"
6040+
"githubID": "GHSA-55q2-fjhq-7xh7",
6041+
"CVE": [
6042+
"CVE-2026-75838"
6043+
]
60416044
},
60426045
"info": [
60436046
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7",

repository/jsrepository-v4.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6036,7 +6036,10 @@
60366036
],
60376037
"identifiers": {
60386038
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
6039-
"githubID": "GHSA-55q2-fjhq-7xh7"
6039+
"githubID": "GHSA-55q2-fjhq-7xh7",
6040+
"CVE": [
6041+
"CVE-2026-75838"
6042+
]
60406043
},
60416044
"info": [
60426045
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7",

repository/jsrepository-v5-combined.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6043,7 +6043,10 @@
60436043
],
60446044
"identifiers": {
60456045
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
6046-
"githubID": "GHSA-55q2-fjhq-7xh7"
6046+
"githubID": "GHSA-55q2-fjhq-7xh7",
6047+
"CVE": [
6048+
"CVE-2026-75838"
6049+
]
60476050
},
60486051
"info": [
60496052
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7",

repository/jsrepository-v5.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6042,7 +6042,10 @@
60426042
],
60436043
"identifiers": {
60446044
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
6045-
"githubID": "GHSA-55q2-fjhq-7xh7"
6045+
"githubID": "GHSA-55q2-fjhq-7xh7",
6046+
"CVE": [
6047+
"CVE-2026-75838"
6048+
]
60466049
},
60476050
"info": [
60486051
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7",

repository/jsrepository-v6-combined.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6111,7 +6111,10 @@
61116111
],
61126112
"identifiers": {
61136113
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
6114-
"githubID": "GHSA-55q2-fjhq-7xh7"
6114+
"githubID": "GHSA-55q2-fjhq-7xh7",
6115+
"CVE": [
6116+
"CVE-2026-75838"
6117+
]
61156118
},
61166119
"details": "### Summary\n\nDuring `IN_PLACE` sanitization, a hook that removes an element can leave that element's detached descendants executable. A descendant image can retain its attacker-provided `onload` handler and fire after `sanitize()` returns, even though the returned root is clean and the image remains disconnected from the document.\n\n### Details\n\nIn DOMPurify 3.4.12, `_sanitizeElements()` in `src/purify.ts:1862-1904` runs the `beforeSanitizeElements` or `uponSanitizeElement` hook and returns immediately when the hook detached the current node. The return does not call `_neutralizeSubtree(currentNode)`.\n\nThe detached subtree is not added to `DOMPurify.removed`, so the post-walk `IN_PLACE` neutralization cannot reach it. If the browser queued a resource event while the application constructed the detached dirty root, a descendant can therefore retain its handler and execute after sanitization.\n\nThe hook only rejects the containing element and does not add or approve the event handler. DOMPurify's ordinary removal path de-arms the same queued event; only the hook-detachment early return skips the existing subtree neutralization.\n\n### PoC\n\nLoad the published `dompurify@3.4.12` `dist/purify.js` before this script in Chromium:\n\n```html\n<div id=\"result\">not fired</div>\n<script>\nconst root = document.createElement('div');\nroot.innerHTML = `\n <footer>\n <img src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n onload=\"result.textContent = 'XSS after sanitize'\">\n </footer>\n <div>safe</div>`;\n\nDOMPurify.setConfig({\n ALLOWED_TAGS: ['div', '#text', 'footer'],\n IN_PLACE: true\n});\nDOMPurify.addHook('uponSanitizeElement', node => {\n if (node.tagName === 'FOOTER') node.remove();\n});\n\nDOMPurify.sanitize(root);\ndocument.body.append(root);\n</script>\n```\n\n`sanitize()` returns with no handler execution and the returned root contains only the safe `div`. After the event loop advances, the original image remains disconnected but its retained `onload` changes the page to `XSS after sanitize`.\n\nAs the claim-matched control, use the same detached input with `ALLOWED_TAGS: ['div', '#text']` and no hook. DOMPurify's ordinary removal path removes the original image's handler, the returned root is still `<div>safe</div>`, and the marker does not fire.\n\n### Impact\n\nIn an application that uses `IN_PLACE` with the documented element-removal hook pattern, an attacker who can supply HTML can execute JavaScript in the integrating application's origin after the application sanitizes and renders that content.\n\nThe required non-default configuration is `IN_PLACE` plus a hook that removes a containing element. The hook does not add or approve the event handler, and the dirty root never needs to be connected before sanitization.\n\n### Suggested fix\n\nReuse the existing `_neutralizeSubtree(currentNode)` helper before returning from both hook-detachment branches in `_sanitizeElements()`. Add regressions for `beforeSanitizeElements` and `uponSanitizeElement` that retain a reference to a descendant resource element and verify that its event handler is removed after the hook detaches its ancestor.",
61176120
"info": [

repository/jsrepository-v6.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6110,7 +6110,10 @@
61106110
],
61116111
"identifiers": {
61126112
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
6113-
"githubID": "GHSA-55q2-fjhq-7xh7"
6113+
"githubID": "GHSA-55q2-fjhq-7xh7",
6114+
"CVE": [
6115+
"CVE-2026-75838"
6116+
]
61146117
},
61156118
"details": "### Summary\n\nDuring `IN_PLACE` sanitization, a hook that removes an element can leave that element's detached descendants executable. A descendant image can retain its attacker-provided `onload` handler and fire after `sanitize()` returns, even though the returned root is clean and the image remains disconnected from the document.\n\n### Details\n\nIn DOMPurify 3.4.12, `_sanitizeElements()` in `src/purify.ts:1862-1904` runs the `beforeSanitizeElements` or `uponSanitizeElement` hook and returns immediately when the hook detached the current node. The return does not call `_neutralizeSubtree(currentNode)`.\n\nThe detached subtree is not added to `DOMPurify.removed`, so the post-walk `IN_PLACE` neutralization cannot reach it. If the browser queued a resource event while the application constructed the detached dirty root, a descendant can therefore retain its handler and execute after sanitization.\n\nThe hook only rejects the containing element and does not add or approve the event handler. DOMPurify's ordinary removal path de-arms the same queued event; only the hook-detachment early return skips the existing subtree neutralization.\n\n### PoC\n\nLoad the published `dompurify@3.4.12` `dist/purify.js` before this script in Chromium:\n\n```html\n<div id=\"result\">not fired</div>\n<script>\nconst root = document.createElement('div');\nroot.innerHTML = `\n <footer>\n <img src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n onload=\"result.textContent = 'XSS after sanitize'\">\n </footer>\n <div>safe</div>`;\n\nDOMPurify.setConfig({\n ALLOWED_TAGS: ['div', '#text', 'footer'],\n IN_PLACE: true\n});\nDOMPurify.addHook('uponSanitizeElement', node => {\n if (node.tagName === 'FOOTER') node.remove();\n});\n\nDOMPurify.sanitize(root);\ndocument.body.append(root);\n</script>\n```\n\n`sanitize()` returns with no handler execution and the returned root contains only the safe `div`. After the event loop advances, the original image remains disconnected but its retained `onload` changes the page to `XSS after sanitize`.\n\nAs the claim-matched control, use the same detached input with `ALLOWED_TAGS: ['div', '#text']` and no hook. DOMPurify's ordinary removal path removes the original image's handler, the returned root is still `<div>safe</div>`, and the marker does not fire.\n\n### Impact\n\nIn an application that uses `IN_PLACE` with the documented element-removal hook pattern, an attacker who can supply HTML can execute JavaScript in the integrating application's origin after the application sanitizes and renders that content.\n\nThe required non-default configuration is `IN_PLACE` plus a hook that removes a containing element. The hook does not add or approve the event handler, and the dirty root never needs to be connected before sanitization.\n\n### Suggested fix\n\nReuse the existing `_neutralizeSubtree(currentNode)` helper before returning from both hook-detachment branches in `_sanitizeElements()`. Add regressions for `beforeSanitizeElements` and `uponSanitizeElement` that retain a reference to a descendant resource element and verify that its event handler is removed after the hook detaches its ancestor.",
61166119
"info": [

repository/jsrepository.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5890,7 +5890,10 @@
58905890
],
58915891
"identifiers": {
58925892
"summary": "DOMPurify: IN_PLACE hook removal leaves a detached subtree executable, causing XSS",
5893-
"githubID": "GHSA-55q2-fjhq-7xh7"
5893+
"githubID": "GHSA-55q2-fjhq-7xh7",
5894+
"CVE": [
5895+
"CVE-2026-75838"
5896+
]
58945897
},
58955898
"info": [
58965899
"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7",

0 commit comments

Comments
 (0)