Skip to content

[GHSA-x4vx-rjvf-j5p4] DOMPurify: IN_PLACE mode trusts attacker-controlled nodeName on live non-form nodes, allowing script retention and XSS via attacker-supplied DOM objects - #9852

Open
Davithi wants to merge 1 commit into
github:Davithi/advisory-improvement-9852from
Davithi:Davithi-GHSA-x4vx-rjvf-j5p4
Open

Davithi wants to merge 1 commit into
github:Davithi/advisory-improvement-9852from
Davithi:Davithi-GHSA-x4vx-rjvf-j5p4

Conversation

@Davithi

@Davithi Davithi commented Sep 29, 2026

Copy link
Copy Markdown

Updates

  • Affected products
  • References

Comments
The advisory lists no patched version. The vulnerability is fixed in dompurify 3.4.8, so the range should be < 3.4.8.

The advisory describes _sanitizeElements taking the tag name from the instance-visible currentNode.nodeName (code path [A]). Commit cure53/DOMPurify@d359b99 ("refined an element nodeName check for better robustness", 2026-05-29) changes exactly that line to read the tag name through the cached Node.prototype.nodeName getter (getNodeName(currentNode)). The commit is in tag 3.4.8 and not in 3.4.7.

Note that the upstream repository advisory lists 3.4.7 as patched, but 3.4.7 is still vulnerable: src/purify.ts at tag 3.4.7 still has const tagName = transformCaseFunc(currentNode.nodeName);. I checked it with jsdom, using a real <script> child whose nodeName is overridden and DOMPurify.sanitize(root, { IN_PLACE: true }):

const script = doc.createElement('script');
script.textContent = 'alert(1)';
Object.defineProperty(script, 'nodeName', { value: 'P' });
root.appendChild(script);
DOMPurify.sanitize(root, { IN_PLACE: true });
// is the <script> still in root?
version spoofed <script> kept
3.4.6 yes (vulnerable)
3.4.7 yes (vulnerable)
3.4.8 no (fixed)
3.4.16 no (fixed)

A plain <script> without the spoofed nodeName is removed by all four versions.

🤖 Generated with Claude Code

…commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot changed the base branch from main to Davithi/advisory-improvement-9852 September 29, 2026 16:15
aungzayyanaing added a commit to aungzayyanaing/advisory-database that referenced this pull request Nov 13, 2026
Add the aiohttp v3.10.11 release page (https://github.com/aio-libs/aiohttp/releases/tag/v3.10.11) as a WEB reference for GHSA-27mf-ghqm-j3j8 (CVE-2024-52303). The release notes describe the same fix: "Fixed system routes polluting the middleware cache -- by bdraco" (github#9852).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant