Dompurify Cure53 Dompurify

Don't miss out!

Thousands of developers use stack.watch to stay informed.
Get an email whenever new security vulnerabilities are reported in Cure53 Dompurify.

By the Year

In 2026 there have been 21 vulnerabilities in Cure53 Dompurify with an average score of 6.3 out of ten. Dompurify did not have any published security vulnerabilities last year. That is, 21 more vulnerabilities have already been reported in 2026 as compared to last year.




Year Vulnerabilities Average Score
2026 21 6.28
2025 0 0.00
2024 1 9.10
2023 1 0.00
2022 0 0.00
2021 0 0.00
2020 1 6.10
2019 1 6.10

It may take a day or so for new Dompurify vulnerabilities to show up in the stats or in the list of recent security vulnerabilities. Additionally vulnerabilities may be tagged under a different product or component name.

Recent Cure53 Dompurify Security Vulnerabilities

DOMPurify<3.4.12 Custom Elements Attr Bypass
CVE-2026-66010 6.1 - Medium - July 24, 2026

DOMPurify before 3.4.12 fails to execute afterSanitizeElements hook for custom elements allowed via CUSTOM_ELEMENT_HANDLING.tagNameCheck, allowing attributes to bypass application security policies. Attackers can preserve sensitive attributes on custom elements that later re-inject them into innerHTML sinks, creating second-order XSS gadgets.

XSS

DOMPurify <3.3.2 Mutation-XSS via reinserted innerHTML wrappers
CVE-2026-65914 - July 23, 2026

DOMPurify before 3.3.2 contains a mutation-XSS vulnerability when sanitized HTML is reinserted into special parsing contexts using innerHTML with wrappers like script, xmp, iframe, noembed, noframes, or noscript. Attackers can craft payloads with closing sequences that break out of the wrapper context during reparsing, reactivating dangerous markup with event handlers to execute JavaScript.

XSS

DOMPurify <3.3.2 Prototype Pollution in USE_PROFILES Allows DOM XSS
CVE-2026-65913 6.1 - Medium - July 23, 2026

DOMPurify before 3.3.2 contains a prototype pollution vulnerability in USE_PROFILES mode that allows attackers to bypass attribute filtering by polluting Array.prototype properties. Attackers can set Array.prototype properties like onclick to true, causing DOMPurify to accept event handlers as allowlisted attributes and resulting in DOM-based XSS when sanitized markup is rendered.

Prototype Pollution

DOMPurify <3.3.2 URI Validation Bypass via ADD_ATTR Predicate
CVE-2026-65912 6.1 - Medium - July 23, 2026

DOMPurify before 3.3.2 contains a URI validation bypass vulnerability when ADD_ATTR is provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. Attackers can supply a predicate that accepts specific attribute and tag combinations to bypass URI-safe validation, allowing unsafe protocols like javascript: to survive sanitization and execute as DOM-based XSS when the link is activated.

XSS

DOMPurify <=3.3.3: Predicate Persistence Across Sanitization Causing XSS
CVE-2026-65911 6.1 - Medium - July 23, 2026

In DOMPurify through 3.3.3, function predicates supplied via ADD_ATTR or ADD_TAGS to DOMPurify.sanitize() persist in internal state (EXTRA_ELEMENT_HANDLING) across subsequent sanitize() calls on the same instance. If a later call on the same instance provides ADD_ATTR or ADD_TAGS as an array rather than a function, the previously set function handler is neither cleared nor overwritten, so it continues to approve attacker-controlled attributes or tags. This can allow dangerous event-handler attributes or forbidden tags (bypassing FORBID_TAGS) to survive sanitization, resulting in cross-site scripting. The vendor (Cure53) considers this an edge case outside DOMPurify's threat model; the referenced advisory lists 3.4.0 as the patched version.

XSS

DOMPurify <=3.3.3 IN_PLACE XSS via foreignrealm node stringification
CVE-2026-65904 4.7 - Medium - July 23, 2026

DOMPurify through 3.3.3 fails to sanitize DOM elements passed via IN_PLACE mode when the element originates from a different window/realm (e.g., an iframe's contentDocument). A cross-realm instanceof check in the private _isNode() function returns false for foreign-realm nodes, causing DOMPurify to stringify the element (yielding '[object HTMLDivElement]'), silently reset IN_PLACE to false, and return the unsanitized element unchanged with any XSS payloads intact.

Improper Check for Unusual or Exceptional Conditions

DOMPurify <3.4.0 Logic Error: ADD_TAGS Bypass FORBID_TAGS (CVE-2026-65903)
CVE-2026-65903 6.1 - Medium - July 23, 2026

DOMPurify before 3.4.0 contains a logic error in the ADD_TAGS function where short-circuit evaluation allows forbidden tags to bypass FORBID_TAGS restrictions. Attackers can craft input containing tags listed in FORBID_TAGS that are also added via ADD_TAGS function, causing them to be retained in sanitized output.

Incorrect Comparison

DOMPurify <=3.4.5 Weakens Default Allow-Lists via Hook Mutation
CVE-2026-65902 6.1 - Medium - July 23, 2026

DOMPurify before 3.4.7 (affected versions <= 3.4.5) passes direct references to the module-level DEFAULT_ALLOWED_TAGS and DEFAULT_ALLOWED_ATTR sets to the uponSanitizeElement and uponSanitizeAttribute hooks via data.allowedTags / data.allowedAttributes when sanitize is called without an explicit cfg.ALLOWED_TAGS / cfg.ALLOWED_ATTR array. A hook that mutates these fields permanently widens the default allow-lists for the lifetime of the DOMPurify instance, so all subsequent default-config sanitize calls inherit the widened defaults and attacker payloads using the poisoned tag/attribute name survive sanitization. removeAllHooks(), clearConfig(), and passing a fresh cfg do not recover the state; only constructing a new DOMPurify instance does.

Trust Boundary Violation

DOMPurify 3.4.6 XSS via IN_PLACE mode trusts attacker nodeName
CVE-2026-65901 6.1 - Medium - July 23, 2026

DOMPurify through 3.4.6 contains a cross-site scripting vulnerability in IN_PLACE mode that trusts attacker-controlled nodeName on live non-form nodes. Attackers can supply hostile live DOM objects with real script children whose observable nodeName is clobbered to appear as allowed elements, causing scripts to execute when the sanitized tree is inserted into a live document.

XSS

DOMPurify 3.0.0-3.4.7 SAFE_FOR_TEMPLATES Bypass via <template> expressions
CVE-2026-65900 6.1 - Medium - July 23, 2026

DOMPurify versions >=3.0.0 and before 3.4.8, when configured with SAFE_FOR_TEMPLATES together with a DOM output mode (RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE), fail to strip template expressions (e.g. ${evil}, {{evil}}, <%evil%>) inside <template> element content. The final normalization/scrub pass (_scrubTemplateExpressions) uses a NodeIterator and node.normalize() that do not descend into template.content, so expressions that only form after adjacent text nodes merge survive sanitization. This bypasses SAFE_FOR_TEMPLATES and can allow a downstream template engine to evaluate attacker-supplied expressions. The string output path is not affected.

XSS

DOMPurify <3.4.9 Trusted Types Policy Not Cleared on clearConfig()
CVE-2026-65899 6.1 - Medium - July 23, 2026

DOMPurify 3.0.0 before 3.4.9 does not reset the retained Trusted Types policy when clearConfig() is called, so a DOMPurify instance reused across trust boundaries stays bound to a previously supplied TRUSTED_TYPES_POLICY. A later caller that requests RETURN_TRUSTED_TYPE output receives a TrustedHTML object created by the old (potentially unsafe) policy rather than a clean default, which can lead to script execution at a Trusted Types sink. Passing TRUSTED_TYPES_POLICY: null on the later call also does not clear the retained policy.

Protection Mechanism Failure

DOMPurify <3.4.11 Allowlist Mutation via uponSanitizeAttribute XSS
CVE-2026-65898 7.2 - High - July 23, 2026

DOMPurify before 3.4.11 fails to clone the ALLOWED_ATTR allowlist when setConfig() is used with an uponSanitizeAttribute hook, allowing the hook to permanently mutate the shared allowlist. Attackers can register a hook that conditionally allows dangerous attributes like onerror for trusted elements, then submit untrusted content that inherits the polluted allowlist and executes event handlers as stored XSS.

XSS

DOMPurify 3.4.7: IN_PLACE Sanitize Skips Shadow in <template>
CVE-2026-49978 - July 14, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.7, DOMPurify IN_PLACE sanitization could skip shadow contents attached to an element inside <template>.content, allowing attacker-controlled markup such as event handlers, JavaScript URLs, or scripts to survive and execute when an application cloned and inserted the sanitized template. This issue is fixed in version 3.4.7.

XSS

DOMPurify<3.4.6 XSS: Preserve EventHandler Attrs on <form>
CVE-2026-49459 6.1 - Medium - July 14, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.6, DOMPurify.sanitize(root, { IN_PLACE: true }) could preserve event-handler attributes on an attacker-controlled <form> root when a descendant name clobbered properties checked by _isClobbered, because _forceRemove no-opped on the parent-less root and _sanitizeAttributes returned early. This issue is fixed in version 3.4.6.

XSS

DOMPurify <3.4.6 XSS via IN_PLACE with foreign-realm nodes
CVE-2026-49458 6.1 - Medium - July 14, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.6, DOMPurify.sanitize(node, { IN_PLACE: true }) accepted same-origin foreign-realm DOM nodes while follow-on checks used parent-realm constructors, causing instanceof checks for forms, named node maps, document fragments, and elements to fail and skip clobber, template-content, and shadow-DOM sanitization branches so executable markup could survive. This issue is fixed in version 3.4.6.

XSS

DOMPurify <3.4.5: selectedcontent defaults to unsanitized XSS
CVE-2026-47423 8.2 - High - July 14, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. In 3.4.4, DOMPurify allowed selectedcontent by default, allowing browsers to re-clone an XSS payload after sanitization so that unsanitized markup inside <selectedcontent> is returned. This issue is fixed in version 3.4.5.

XSS

DOMPurify <=3.3.5: FORBID_TAGS/ATTR skip leads to XSS
CVE-2026-41240 - April 23, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions prior to 3.4.0 have an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used. Commit c361baa added an early exit for FORBID_ATTR at line 1214. The same fix was not applied to FORBID_TAGS. At line 1118-1123, when EXTRA_ELEMENT_HANDLING.tagCheck returns true, the short-circuit evaluation skips the FORBID_TAGS check entirely. This allows forbidden elements to survive sanitization with their attributes intact. Version 3.4.0 patches the issue.

Allowlist / Allow List

DOMPurify 1.0.103.3.9 XSS via SAFE_FOR_TEMPLATES
CVE-2026-41239 6.8 - Medium - April 23, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Starting in version 1.0.10 and prior to version 3.4.0, `SAFE_FOR_TEMPLATES` strips `{{...}}` expressions from untrusted HTML. This works in string mode but not with `RETURN_DOM` or `RETURN_DOM_FRAGMENT`, allowing XSS via template-evaluating frameworks like Vue 2. Version 3.4.0 patches the issue.

XSS

DOMPurify 3.0.1-3.3.3: XSS by Prototype Pollution (fixed in 3.4.0)
CVE-2026-41238 6.9 - Medium - April 23, 2026

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions 3.0.1 through 3.3.3 are vulnerable to a prototype pollution-based XSS bypass. When an application uses `DOMPurify.sanitize()` with the default configuration (no `CUSTOM_ELEMENT_HANDLING` option), a prior prototype pollution gadget can inject permissive `tagNameCheck` and `attributeNameCheck` regex values into `Object.prototype`, causing DOMPurify to allow arbitrary custom elements with arbitrary attributes including event handlers through sanitization. Version 3.4.0 fixes the issue.

XSS

DOMPurify 3.1.3-3.3.1 XSS via Missing Rawtext Elements
CVE-2026-0540 6.1 - Medium - March 03, 2026

DOMPurify 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8, fixed in commit 2726c74, contain a cross-site scripting vulnerability that allows attackers to bypass attribute sanitization by exploiting five missing rawtext elements (noscript, xmp, noembed, noframes, iframe) in the SAFE_FOR_XML regex. Attackers can include payloads like </noscript><img src=x onerror=alert(1)> in attribute values to execute JavaScript when sanitized output is placed inside these unprotected rawtext contexts.

XSS

XSS via missing textarea check in DOMPurify 3.1.33.2.6 & 2.5.32.5.8
CVE-2025-15599 6.1 - Medium - March 03, 2026

DOMPurify 3.1.3 through 3.2.6 and 2.5.3 through 2.5.8 contain a cross-site scripting vulnerability that allows attackers to bypass attribute sanitization by exploiting missing textarea rawtext element validation in the SAFE_FOR_XML regex. Attackers can include closing rawtext tags like </textarea> in attribute values to break out of rawtext contexts and execute JavaScript when sanitized output is placed inside rawtext elements. The 3.x branch was fixed in 3.2.7; the 2.x branch was never patched.

XSS

DOMPurify Prototype Pollution XSS | Vulnerable before 2.4.2
CVE-2024-48910 9.1 - Critical - October 31, 2024

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify was vulnerable to prototype pollution. This vulnerability is fixed in 2.4.2.

Prototype Pollution

DOMPurify <1.0.11 RevTabnabbing via missing rel=noopener in demo
CVE-2019-25155 - November 07, 2023

DOMPurify before 1.0.11 allows reverse tabnabbing in demos/hooks-target-blank-demo.html because links lack a 'rel="noopener noreferrer"' attribute.

Cure53 DOMPurify before 2.0.17 allows mutation XSS
CVE-2020-26870 6.1 - Medium - October 07, 2020

Cure53 DOMPurify before 2.0.17 allows mutation XSS. This occurs because a serialize-parse roundtrip does not necessarily return the original DOM tree, and a namespace can change from HTML to MathML, as demonstrated by nesting of FORM elements.

XSS

DOMPurify before 2.0.1
CVE-2019-16728 6.1 - Medium - September 24, 2019

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.

XSS

Stay on top of Security Vulnerabilities

Want an email whenever new vulnerabilities are published for Cure53 Dompurify or by Cure53? Click the Watch button to subscribe.

Cure53
Vendor

subscribe