{"id":"DHI-7rvn-my27-ijmf-4mcg","summary":"### Summary","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\u003cdiv id=\"result\"\u003enot fired\u003c/div\u003e\n\u003cscript\u003e\nconst root = document.createElement('div');\nroot.innerHTML = `\n  \u003cfooter\u003e\n    \u003cimg src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n         onload=\"result.textContent = 'XSS after sanitize'\"\u003e\n  \u003c/footer\u003e\n  \u003cdiv\u003esafe\u003c/div\u003e`;\n\nDOMPurify.setConfig({\n  ALLOWED_TAGS: ['div', '#text', 'footer'],\n  IN_PLACE: true\n});\nDOMPurify.addHook('uponSanitizeElement', node =\u003e {\n  if (node.tagName === 'FOOTER') node.remove();\n});\n\nDOMPurify.sanitize(root);\ndocument.body.append(root);\n\u003c/script\u003e\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 `\u003cdiv\u003esafe\u003c/div\u003e`, 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.","modified":"2026-11-21T14:30:09.346200364Z","published":"2026-11-14T07:57:14Z","upstream":["GHSA-55q2-fjhq-7xh7"],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-7rvn-my27-ijmf-4mcg"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-55q2-fjhq-7xh7"},{"type":"ADVISORY","url":"https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7"},{"type":"FIX","url":"https://github.com/cure53/DOMPurify/pull/1557"},{"type":"FIX","url":"https://github.com/cure53/DOMPurify/commit/3067f7746769"},{"type":"WEB","url":"https://github.com/cure53/DOMPurify/releases/tag/3.4.13"}],"affected":[{"package":{"name":"gitea-dev","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/gitea-dev"},"versions":["1.26.4-r1","1.27.0-r1","1.27.0-r2","1.27.1-r0","1.27.1-r1","1.27.1-r2","1.27.1-r3","1.27.2-r0","1.27.2-r1","1.27.2-r2","1.27.2-r3","1.27.2-r4","1.27.3-r0","1.27.3-r1","1.27.3-r10","1.27.3-r11","1.27.3-r12","1.27.3-r13","1.27.3-r14","1.27.3-r15","1.27.3-r16","1.27.3-r17","1.27.3-r18","1.27.3-r19","1.27.3-r2","1.27.3-r20","1.27.3-r3","1.27.3-r4","1.27.3-r5","1.27.3-r7","1.27.3-r8","1.27.3-r9","28.3.0-r0","28.3.0-r1","28.3.0-r2","28.3.0-r3","28.3.0-r4","28.4.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"gitea-fips-dev","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/gitea-fips-dev"},"versions":["1.26.4-r1","1.27.0-r1","1.27.0-r2","1.27.1-r0","1.27.1-r1","1.27.1-r2","1.27.1-r3","1.27.2-r0","1.27.2-r1","1.27.2-r2","1.27.2-r3","1.27.2-r4","1.27.3-r0","1.27.3-r1","1.27.3-r10","1.27.3-r11","1.27.3-r12","1.27.3-r13","1.27.3-r14","1.27.3-r15","1.27.3-r16","1.27.3-r17","1.27.3-r18","1.27.3-r19","1.27.3-r2","1.27.3-r20","1.27.3-r3","1.27.3-r4","1.27.3-r5","1.27.3-r7","1.27.3-r8","1.27.3-r9","28.3.0-r0","28.3.0-r1","28.3.0-r2","28.3.0-r3","28.3.0-r4","28.4.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"gitea-fips","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/gitea-fips"},"versions":["1.26.4-r1","1.27.0-r1","1.27.0-r2","1.27.1-r0","1.27.1-r1","1.27.1-r2","1.27.1-r3","1.27.2-r0","1.27.2-r1","1.27.2-r2","1.27.2-r3","1.27.2-r4","1.27.3-r0","1.27.3-r1","1.27.3-r10","1.27.3-r11","1.27.3-r12","1.27.3-r13","1.27.3-r14","1.27.3-r15","1.27.3-r16","1.27.3-r17","1.27.3-r18","1.27.3-r19","1.27.3-r2","1.27.3-r20","1.27.3-r3","1.27.3-r4","1.27.3-r5","1.27.3-r7","1.27.3-r8","1.27.3-r9","28.3.0-r0","28.3.0-r1","28.3.0-r2","28.3.0-r3","28.3.0-r4","28.4.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"gitea","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/gitea"},"versions":["1.26.4-r1","1.27.0-r1","1.27.0-r2","1.27.1-r0","1.27.1-r1","1.27.1-r2","1.27.1-r3","1.27.2-r0","1.27.2-r1","1.27.2-r2","1.27.2-r3","1.27.2-r4","1.27.3-r0","1.27.3-r1","1.27.3-r10","1.27.3-r11","1.27.3-r12","1.27.3-r13","1.27.3-r14","1.27.3-r15","1.27.3-r16","1.27.3-r17","1.27.3-r18","1.27.3-r19","1.27.3-r2","1.27.3-r20","1.27.3-r3","1.27.3-r4","1.27.3-r5","1.27.3-r7","1.27.3-r8","1.27.3-r9","28.3.0-r0","28.3.0-r1","28.3.0-r2","28.3.0-r3","28.3.0-r4","28.4.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"kiali-server-dev","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/kiali-server-dev"},"versions":["2.30.0-r1","2.31.0-r0","2.31.0-r1","2.31.0-r2","2.31.0-r3","2.31.0-r4","2.32.0-r0","2.32.0-r1","2.32.0-r2","2.32.0-r3","2.33.0-r0","2.33.0-r1","2.33.0-r2","2.33.0-r3","2.33.0-r4","2.33.0-r5","2.33.0-r6","2.34.0-r0","2.34.0-r1","2.34.1-r0","2.34.1-r1","2.34.1-r2","2.34.1-r3","2.34.1-r4","2.35.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"kiali-server-fips-dev","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/kiali-server-fips-dev"},"versions":["2.30.0-r1","2.31.0-r0","2.31.0-r1","2.31.0-r2","2.31.0-r3","2.31.0-r4","2.32.0-r0","2.32.0-r1","2.32.0-r2","2.32.0-r3","2.33.0-r0","2.33.0-r1","2.33.0-r2","2.33.0-r3","2.33.0-r4","2.33.0-r5","2.33.0-r6","2.34.0-r0","2.34.0-r1","2.34.1-r0","2.34.1-r1","2.34.1-r2","2.34.1-r3","2.34.1-r4","2.35.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"kiali-server-fips","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/kiali-server-fips"},"versions":["2.30.0-r1","2.31.0-r0","2.31.0-r1","2.31.0-r2","2.31.0-r3","2.31.0-r4","2.32.0-r0","2.32.0-r1","2.32.0-r2","2.32.0-r3","2.33.0-r0","2.33.0-r1","2.33.0-r2","2.33.0-r3","2.33.0-r4","2.33.0-r5","2.33.0-r6","2.34.0-r0","2.34.0-r1","2.34.1-r0","2.34.1-r1","2.34.1-r2","2.34.1-r3","2.34.1-r4","2.35.0-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"kiali-server","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/kiali-server"},"versions":["2.30.0-r1","2.31.0-r0","2.31.0-r1","2.31.0-r2","2.31.0-r3","2.31.0-r4","2.32.0-r0","2.32.0-r1","2.32.0-r2","2.32.0-r3","2.33.0-r0","2.33.0-r1","2.33.0-r2","2.33.0-r3","2.33.0-r4","2.33.0-r5","2.33.0-r6","2.34.0-r0","2.34.0-r1","2.34.1-r0","2.34.1-r1","2.34.1-r2","2.34.1-r3","2.34.1-r4","2.35.0-r0"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json","owner_kind":"HSP"}},{"package":{"name":"datahub-ingestion","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/datahub-ingestion"},"versions":["1.5.0.7-0","1.6.0.1-0","1.6.0.1-1","1.6.0.1-2","1.6.0.1-3","1.6.0.2-0","1.6.0.2-1","1.7.0.10-0","1.7.0.12-0","1.7.0.13-0","1.7.0.14-0","1.7.0.14-1","1.7.0.14-2","1.7.0.16-0","1.7.0.16-1","1.7.0.17-0","1.7.0.17-1","1.7.0.17-2","1.7.0.17-3","1.7.0.18-0","1.7.0.19-0","1.7.0.19-1","1.7.0.19-2","1.7.0.19-3","1.7.0.19-4","1.7.0.19-5","1.7.0.19-6","1.7.0.20-6","1.7.0.20-7","1.7.0.20-8"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"grist","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/grist"},"versions":["1.7.17-0","1.7.17-1","1.7.17-2","1.7.17-3","1.7.17-4","1.7.17-5","1.7.17-6","1.7.19-2","1.7.19-3","1.7.19-4","1.7.19-5","1.7.19-6","1.7.20-0","1.7.20-10","1.7.20-7","1.7.20-8","1.7.20-9","1.7.21-0","1.7.21-1","1.7.21-2","1.7.21-3","1.7.21-4","1.7.21-5","1.7.21-6","1.7.21-7","1.7.21-8","1.7.21-9","1.7.22-1","1.7.22-10","1.7.22-11","1.7.22-12","1.7.22-13","1.7.22-2","1.7.22-3","1.7.22-4","1.7.22-5","1.7.22-6","1.7.22-7","1.7.22-8","1.7.22-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"langfuse-2","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/langfuse-2"},"versions":["2.95.12-0","2.95.12-1","2.95.12-10","2.95.12-11","2.95.12-12","2.95.12-13","2.95.12-2","2.95.12-3","2.95.12-4","2.95.12-5","2.95.12-6","2.95.12-7","2.95.12-8","2.95.12-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"opencost-ui","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/opencost-ui"},"versions":["1.121.0-0","1.121.1-0","1.121.1-1","1.121.1-2","1.121.2-0","1.121.3-0","1.121.3-2","1.121.3-3","1.121.3-4","1.121.3-5","1.121.3-6","1.121.3-7","1.121.4-0","1.121.4-1"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json","owner_kind":"HSP"}},{"package":{"name":"superset","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/superset"},"versions":["6.1.0-0","6.1.0-1","6.1.0-10","6.1.0-11","6.1.0-12","6.1.0-13","6.1.0-14","6.1.0-15","6.1.0-16","6.1.0-17","6.1.0-18","6.1.0-19","6.1.0-2","6.1.0-20","6.1.0-21","6.1.0-22","6.1.0-23","6.1.0-24","6.1.0-25","6.1.0-26","6.1.0-27","6.1.0-28","6.1.0-29","6.1.0-3","6.1.0-30","6.1.0-31","6.1.0-32","6.1.0-33","6.1.0-34","6.1.0-35","6.1.0-36","6.1.0-37","6.1.0-38","6.1.0-39","6.1.0-4","6.1.0-40","6.1.0-41","6.1.0-42","6.1.0-5","6.1.0-6","6.1.0-7","6.1.0-8","6.1.0-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}},{"package":{"name":"uptime-kuma-1","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/uptime-kuma-1"},"versions":["1.23.17-0","1.23.17-1","1.23.17-11","1.23.17-2","1.23.17-3","1.23.17-4","1.23.17-5","1.23.17-6","1.23.17-7","1.23.17-8","1.23.17-9"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json","owner_kind":"HSP"}},{"package":{"name":"uptime-kuma-2","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/uptime-kuma-2"},"versions":["2.5.0-0","2.5.0-1","2.5.0-2","2.5.10-0","2.5.11-0","2.5.11-1","2.5.11-2","2.5.11-3","2.5.12-0","2.5.3-0","2.5.3-1","2.5.4-0","2.5.5-0","2.5.5-1","2.5.6-0","2.5.7-0","2.5.7-1","2.5.9-0","2.5.9-1"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-7rvn-my27-ijmf-4mcg.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"}]}