Vulnerabilities/

DOMPurify is vulnerable to mutation-XSS via Re-Contextualization

Severity:
Medium

Description

A mutation-XSS (mXSS) condition was confirmed when sanitized HTML is reinserted into a new parsing context using innerHTML and special wrappers. The vulnerable wrappers confirmed in browser behavior are script, xmp, iframe, noembed, noframes, and noscript. The payload remains seemingly benign after DOMPurify.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).

Recommendation

Update the dompurify package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
dompurify
Anything's wrong? Let us know Last updated on March 27, 2026