org.webjars.npm:dompurify@3.4.13

  • latest version

    3.4.16

  • latest non vulnerable version

  • first published

    8 years ago

  • latest version published

    15 days ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm: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.webjars.npm: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 _sanitizeElements and _sanitizeAttributes in src/purify.ts, which invoke _handleHookDetachedNode only after the beforeSanitizeElements and uponSanitizeElement hooks, so a non-root node removed by an afterSanitizeElements or afterSanitizeAttributes hook keeps its descendants' event handlers armed, and the post-walk neutralization pass covers only entries in DOMPurify.removed, which excludes hook-detached nodes. An attacker can execute script in the page origin under the victim's session by supplying markup with a non-root wrapper whose descendants carry on* handlers, such as an <img onerror>, so a queued resource event fires on the detached subtree after the synchronous sanitize() call has returned. This requires the application to call sanitize() with IN_PLACE: true on a live node and to register a node-removing afterSanitizeElements or afterSanitizeAttributes hook, so callers using the default returning mode or no such hooks are unaffected.

    Note: This is a bypass of the fix for the vulnerability described in CVE-2026-75838.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.webjars.npm:dompurify to version 3.4.16 or higher.

    [3.4.13,3.4.16)