chore(deps): update dependency dompurify to v3.3.2 [security] - autoclosed#758
Closed
renovate[bot] wants to merge 1 commit intomainfrom
Closed
chore(deps): update dependency dompurify to v3.3.2 [security] - autoclosed#758renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
a7ca3db to
0c0fdfd
Compare
19c2d69 to
63de9f2
Compare
63de9f2 to
9494541
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.3.1→3.3.2GitHub Vulnerability Alerts
GHSA-h8r8-wccr-v5f2
Description
A mutation-XSS (mXSS) condition was confirmed when sanitized HTML is reinserted into a new parsing context using
innerHTMLand special wrappers. The vulnerable wrappers confirmed in browser behavior arescript,xmp,iframe,noembed,noframes, andnoscript. The payload remains seemingly benign afterDOMPurify.sanitize(), but mutates during the second parse into executable markup with an event handler, enabling JavaScript execution in the client (alert(1)in the PoC).Vulnerability
The root cause is context switching after sanitization: sanitized output is treated as trusted and concatenated into a wrapper string (for example,
<xmp> ... </xmp>or other special wrappers) before being reparsed by the browser. In this flow, attacker-controlled text inside an attribute (for example</xmp>or equivalent closing sequences for each wrapper) closes the special parsing context early and reintroduces attacker markup (<img ... onerror=...>) outside the original attribute context. DOMPurify sanitizes the original parse tree, but the application performs a second parse in a different context, reactivating dangerous tokens (classic mXSS pattern).PoC
http://localhost:3001.Wrapper en sinktoxmp.Sanitize + Render.Sanitized responsestill contains the</xmp>sequence insidealt.<img src="x" onerror="alert('expoc')">.alert('expoc')is triggered.{ "name": "expoc", "version": "1.0.0", "main": "server.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node server.js", "dev": "node server.js" }, "keywords": [], "author": "", "license": "ISC", "description": "", "dependencies": { "dompurify": "^3.3.1", "express": "^5.2.1", "jsdom": "^28.1.0" } }Evidence
daft-video.webm
Why This Happens
This is a mutation-XSS pattern caused by a parse-context mismatch:
xmpraw-text behavior).</xmp>) gains structural meaning in parse 2 and alters DOM structure.Sanitization is not a universal guarantee across all future parsing contexts. The sink design reintroduces risk.
Remediation Guidance
innerHTML.textContent,createElement,setAttribute) over string-based HTML composition.xmp,script, etc.).</xmp>,</noscript>, similar parser-breakout markers).Reported by Oscar Uribe, Security Researcher at Fluid Attacks. Camilo Vera and Cristian Vargas from the Fluid Attacks Research Team have identified a mXSS via Re-Contextualization in DomPurify 3.3.1.
Following Fluid Attacks Disclosure Policy, if this report corresponds to a vulnerability and the conditions outlined in the policy are met, this advisory will be published on the website over the next few days (the timeline may vary depending on maintainers' willingness to attend to and respond to this report) at the following URL: https://fluidattacks.com/advisories/daft
Acknowledgements: Camilo Vera and Cristian Vargas.
Release Notes
cure53/DOMPurify (dompurify)
v3.3.2: DOMPurify 3.3.2Compare Source
_isValidAttribute, thanks @christos-ethConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.