org.mvnpm:dompurify@3.3.2

  • latest version

    3.4.17

  • latest non vulnerable version

  • first published

    2 years ago

  • latest version published

    1 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:dompurify package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the _sanitizeAttributes function when PARSER_MEDIA_TYPE is set to application/xhtml+xml. In XHTML mode, transformCaseFunc is the identity function rather than stringToLowerCase, so the guard that removes attributeName attributes whose value contains href compares the preserved-case name attributeName against the lowercase literal "attributename" and never matches. An attacker can supply SVG content containing an <animate> or <set> element with attributeName="href" and a SMIL values list ending in a javascript: URI, which bypasses link filtering and executes a script in the victim's browser when the parent link is clicked.

    Note: This is only exploitable when PARSER_MEDIA_TYPE: 'application/xhtml+xml' is explicitly set and the allowlist includes animate (or set) together with attributeName.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.17 or higher.

    [,3.4.17)
    • H
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via _handleHookDetachedNode() in src/purify.ts when IN_PLACE mode is used with a hook that removes a node other than the hook's own node (such as a parent, ancestor, or unvisited sibling). The function only checks whether currentNode itself lost its parent, so when a hook removes currentNode.parentNode or a later sibling, the detached subtree is never walked or neutralized by DOMPurify. Event handlers on elements in that detached subtree remain armed, and handlers such as img onerror fire after sanitize() returns, resulting in DOM XSS.

    Note: This is only exploitable when IN_PLACE: true is used together with a hook (any of beforeSanitizeElements, uponSanitizeElement, afterSanitizeElements, beforeSanitizeAttributes, or afterSanitizeAttributes) that removes a node other than the hook's own node.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.17 or higher.

    [,3.4.17)
    • H
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via a bypass in the sanitization logic that allows malicious HTML to survive the purification pass. An attacker can inject a payload into user-controlled input that DOMPurify fails to strip, resulting in arbitrary script execution in the victim's browser context.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.17 or higher.

    [,3.4.17)
    • L
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via a non-default configuration that allows certain literal text elements, where the LITERAL_TEXT_CLOSE regex-based closing-tag detection logic can be bypassed, allowing an attacker to inject unsanitized HTML that executes arbitrary scripts in the victim's browser. The fix removes the regex-based approach and introduces a lookupAccessor helper alongside Set-based tracking to harden element handling.

    Note: This is only exploitable when a non-default DOMPurify configuration is used; the default configuration is not affected.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.17 or higher.

    [,3.4.17)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via insufficient sanitization in the HTML purification logic, allowing an attacker to inject and execute arbitrary JavaScript in a victim's browser by supplying malicious HTML input that bypasses DOMPurify's filtering.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.16 or higher.

    [,3.4.16)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the IN_PLACE sanitization process when a hook removes an element, leaving its detached descendants with executable event handlers. An attacker can execute arbitrary JavaScript code in the application's origin by supplying crafted HTML that leverages this behavior. This is only exploitable if the application uses the IN_PLACE configuration along with a hook that removes a containing element.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.13 or higher.

    [,3.4.13)
    • L
    Improper Check for Unusual or Exceptional Conditions

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Improper Check for Unusual or Exceptional Conditions in the IN_PLACE process when DOM elements are passed from a different window or realm, such as an iframe's contentDocument. An attacker can inject and execute arbitrary scripts by supplying a crafted DOM element from a foreign realm, which bypasses sanitization and leaves malicious payloads intact. This is only exploitable if the application uses the IN_PLACE mode with DOM elements originating from a different window or realm.

    How to fix Improper Check for Unusual or Exceptional Conditions?

    Upgrade org.mvnpm:dompurify to version 3.4.5 or higher.

    [,3.4.5)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the sanitize process. An attacker can execute arbitrary scripts in the context of the user’s browser by leveraging persistent function predicates supplied via ADD_ATTR or ADD_TAGS that are not cleared or overwritten across subsequent calls, allowing approval of attacker-controlled attributes or tags.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.0 or higher.

    [,3.4.0)
    • L
    Incomplete List of Disallowed Inputs

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Incomplete List of Disallowed Inputs in the CUSTOM_ELEMENT_HANDLING. An attacker can cause security-relevant attributes to be preserved on allowed custom elements by leveraging the bypass of the afterSanitizeElements hook, which may result in these attributes being re-injected into an HTML sink such as innerHTML and executed in a later context.

    Note: This is only exploitable if the application enables CUSTOM_ELEMENT_HANDLING, relies on afterSanitizeElements as a security policy layer, and has custom elements that re-inject preserved attribute values into an HTML sink.

    How to fix Incomplete List of Disallowed Inputs?

    Upgrade org.mvnpm:dompurify to version 3.4.12 or higher.

    [,3.4.12)
    • M
    Improper Initialization

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Improper Initialization in the DOMPurify.setConfig() API when an uponSanitizeAttribute hook is registered that mutates allowedAttributes. An attacker can cause persistent modification of the attribute allowlist by submitting specially crafted content, resulting in unauthorized attributes being permitted in all subsequent sanitization calls.

    How to fix Improper Initialization?

    Upgrade org.mvnpm:dompurify to version 3.4.11 or higher.

    [,3.4.11)
    • L
    Protection Mechanism Failure

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Protection Mechanism Failure through the clearConfig function. An attacker can execute arbitrary scripts in a Trusted Types sink by influencing a previously supplied TRUSTED_TYPES_POLICY on a reused instance and later triggering output with RETURN_TRUSTED_TYPE: true.

    Note:

    This is only exploitable if a DOMPurify instance is reused across trust boundaries and a less-trusted integration or attacker has previously set an unsafe Trusted Types policy.

    How to fix Protection Mechanism Failure?

    Upgrade org.mvnpm:dompurify to version 3.4.9 or higher.

    [,3.4.9)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the SAFE_FOR_TEMPLATES function. An attacker can inject template expressions that survive sanitization inside <template> element content by splitting malicious expressions across adjacent text nodes, which are not properly scrubbed. This allows execution of arbitrary code or exfiltration of sensitive data if a downstream template engine evaluates the merged content.

    This is only exploitable if both SAFE_FOR_TEMPLATES: true and either RETURN_DOM: true, RETURN_DOM_FRAGMENT: true, or IN_PLACE: true are explicitly set, and the application processes <template>.content with a template engine.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.8 or higher.

    [3.0.6,3.4.8)
    • M
    Prototype Pollution

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Prototype Pollution in the IN_PLACE function when sanitizing a root element that is a <form> with event handler attributes and a descendant element whose name attribute matches certain property names checked by _isClobbered. An attacker can cause malicious attributes, such as event handlers or JavaScript URIs, to persist on the root element by crafting a DOM structure where the root is clobbered and then passing it to the sanitizer in IN_PLACE mode. This allows the attacker to execute arbitrary JavaScript or bypass attribute-level defenses when the sanitized node is reinserted into the live document.

    Note:

    This is only exploitable if the sanitizer is used in IN_PLACE mode on a detached root element that is an HTMLFormElement with a clobber-named child.

    How to fix Prototype Pollution?

    Upgrade org.mvnpm:dompurify to version 3.4.6 or higher.

    [,3.4.6)
    • M
    Trust Boundary Violation

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Trust Boundary Violation in the sanitize function when handling DOM nodes from a different same-origin realm due to improper realm-bound instanceof checks. An attacker can inject and execute malicious markup by providing specially crafted DOM nodes from a foreign realm, which bypass internal security checks and allow executable content to persist in form attributes, template content, and attached shadow roots.

    How to fix Trust Boundary Violation?

    Upgrade org.mvnpm:dompurify to version 3.4.6 or higher.

    [,3.4.6)
    • M
    Trust Boundary Violation

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Trust Boundary Violation through the mutation of data.allowedTags or data.allowedAttributes in hooks, which directly alters the global default sets used for sanitization. An attacker can cause persistent changes to the default allow-lists, enabling malicious tags or attributes to bypass sanitization in subsequent calls by injecting payloads that exploit the polluted configuration.

    Note:

    This is only exploitable if a hook is registered that mutates data.allowedTags or data.allowedAttributes, and later sanitization occurs without explicitly setting restrictive configuration arrays.

    How to fix Trust Boundary Violation?

    Upgrade org.mvnpm:dompurify to version 3.4.7 or higher.

    [,3.4.7)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the IN_PLACE function when handling a <template> element containing an element with an attached shadow DOM. An attacker can execute arbitrary scripts in the context of the user by injecting malicious content into the shadow DOM, which is not sanitized and is later executed when the template is cloned and inserted into the page.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.7 or higher.

    [,3.4.7)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the IN_PLACE process when attacker-controlled live DOM nodes are sanitized. An attacker can execute arbitrary scripts in the context of the application by passing a manipulated DOM node with a spoofed nodeName property, causing malicious script elements to be retained and executed upon insertion into the document.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.8 or higher.

    [,3.4.8)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) leading to cross-site scripting, via custom elements. When CUSTOM_ELEMENT_HANDLING is not enabled, and an attacker has already polluted the prototype of objects supplied to DOMPurify.sanitize(), the tagNameCheck and attributeNameCheck regex values allow arbitrary custom elements including event handlers to bypass sanitization.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.0 or higher.

    [3.0.6,3.4.0)
    • L
    Cross-site Scripting (XSS)

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via templates injected to a site in RETURN_DOM mode. The SAFE_FOR_TEMPLATES sanitization can be bypassed, which then allows scripts to be executed if the template is evaluated by a framework such as Vue 2. An application is only vulnerable if it has SAFE_FOR_TEMPLATES: true, and RETURN_DOM: true or RETURN_DOM_FRAGMENT: true set.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:dompurify to version 3.4.0 or higher.

    [2.3.5,3.4.0)
    • M
    Operator Precedence Logic Error

    org.mvnpm:dompurify is a DOM-only XSS sanitizer for HTML, MathML and SVG.

    Affected versions of this package are vulnerable to Operator Precedence Logic Error in the form of short-circuit evaluation that gives precedence to ADD_TAGS over FORBID_TAGS in _sanitizeElements(). In an application where ADD_TAGS is used as a function (via EXTRA_ELEMENT_HANDLING.tagCheck) and FORBID_TAGS is in use, an attacker can cause forbidden tags to be allowed.

    How to fix Operator Precedence Logic Error?

    Upgrade org.mvnpm:dompurify to version 3.4.0 or higher.

    [,3.4.0)