CVE-2019-16728
Description
DOMPurify before 2.0.1 allows XSS because of innerHTML mutation XSS (mXSS) for an SVG element or a MATH element, as demonstrated by Chrome and Safari.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
DOMPurify before 2.0.1 is vulnerable to mutation XSS via innerHTML of SVG or MATH elements, bypassing sanitization in Chrome and Safari.
Vulnerability
Overview
DOMPurify is an HTML sanitizer library designed to prevent cross-site scripting (XSS) by stripping dangerous content. CVE-2019-16728 describes a mutation XSS (mXSS) flaw in versions prior to 2.0.1. The root cause lies in how the library handles SVG and MATH elements: when the sanitized output is later inserted into the DOM via innerHTML, the browser's parser may reinterpret the markup in a way that re-introduces executable scripts. This mutation behavior is specific to certain browsers, notably Chrome and Safari [1].
Exploitation
Prerequisites
An attacker can exploit this vulnerability by crafting a malicious payload that includes SVG or MATH elements. After DOMPurify processes the input, the resulting HTML appears safe. However, when the application assigns this sanitized string to an element's innerHTML property, the browser's HTML parser mutates the content, causing the originally blocked script to execute. No special network position or authentication is required; the attacker only needs to inject the payload into a page that uses DOMPurify and subsequently inserts the sanitized output into the DOM [1].
Impact
Successful exploitation allows arbitrary JavaScript execution in the context of the victim's browser. This can lead to theft of sensitive data, session hijacking, defacement, or further attacks against the application and its users. The vulnerability is particularly dangerous because it bypasses the sanitizer's intended protections, making it a critical issue for any application relying on DOMPurify for XSS defense [1].
Mitigation
The vulnerability is fixed in DOMPurify version 2.0.1. Users should upgrade immediately. No workaround is documented; the only reliable mitigation is to apply the patch. Given that the flaw was demonstrated in Chrome and Safari, applications supporting these browsers are especially at risk [1].
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
dompurifynpm | < 2.0.3 | 2.0.3 |
Affected products
2- DOMPurify/DOMPurifydescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
6- github.com/advisories/GHSA-chqj-j4fh-rw7mghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2019-16728ghsaADVISORY
- lists.debian.org/debian-lts-announce/2020/10/msg00029.htmlghsamailing-listx_refsource_MLISTWEB
- research.securitum.com/dompurify-bypass-using-mxssghsaWEB
- research.securitum.com/dompurify-bypass-using-mxss/mitrex_refsource_MISC
- www.npmjs.com/advisories/1205ghsaWEB
News mentions
0No linked articles in our index yet.