Skip to content

chore(deps): update dependency dompurify to v3.3.2 [security]#758

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-dompurify-vulnerability
Open

chore(deps): update dependency dompurify to v3.3.2 [security]#758
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-dompurify-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Mar 18, 2026

This PR contains the following updates:

Package Change Age Confidence
dompurify 3.3.13.3.2 age confidence

GitHub Vulnerability Alerts

CVE-2026-0540

DOMPurify 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8, fixed in 2.5.9 and 3.3.2, 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.

GHSA-cj63-jhhr-wcxv

Summary

When USE_PROFILES is enabled, DOMPurify rebuilds ALLOWED_ATTR as a plain array before populating it with the requested allowlists. Because the sanitizer still looks up attributes via ALLOWED_ATTR[lcName], any Array.prototype property that is polluted also counts as an allowlisted attribute. An attacker who can set Array.prototype.onclick = true (or a runtime already subject to prototype pollution) can thus force DOMPurify to keep event handlers such as onclick even when they are normally forbidden. The provided PoC sanitizes <img onclick=...> with USE_PROFILES and adds the sanitized output to the DOM; the polluted prototype allows the event handler to survive and execute, turning what should be a blocklist into a silent XSS vector.

Impact

Prototype pollution makes DOMPurify accept dangerous event handler attributes, which bypasses the sanitizer and results in DOM-based XSS once the sanitized markup is rendered.

Credits

Identified by Cantina’s Apex (https://www.cantina.security).

GHSA-cjmm-f4jc-qw8r

Summary

DOMPurify allows ADD_ATTR to be provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. When the predicate returns true, _isValidAttribute short-circuits the attribute check before URI-safe validation runs. An attacker who supplies a predicate that accepts specific attribute/tag combinations can then sanitize input such as <a href="javascript:alert(document.domain)"> and have the javascript: URL survive, because URI validation is skipped for that attribute while other checks still pass. The provided PoC accepts href for anchors and then triggers a click inside an iframe, showing that the sanitized payload executes despite the protocol bypass.

Impact

Predicate-based allowlisting bypasses DOMPurify's URI validation, allowing unsafe protocols such as javascript: to reach the DOM and execute whenever the link is activated, resulting in DOM-based XSS.

Credits

Identified by Cantina’s Apex (https://www.cantina.security).


Release Notes

cure53/DOMPurify (dompurify)

v3.3.2: DOMPurify 3.3.2

Compare Source

  • Fixed a possible bypass caused by jsdom's faulty raw-text tag parsing, thanks multiple reporters
  • Fixed a prototype pollution issue when working with custom elements, thanks @​christos-eth
  • Fixed a lenient config parsing in _isValidAttribute, thanks @​christos-eth
  • Bumped and removed several dependencies, thanks @​Rotzbua
  • Fixed the test suite after bumping dependencies, thanks @​Rotzbua

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the renovate label Mar 18, 2026
@renovate renovate bot force-pushed the renovate/npm-dompurify-vulnerability branch 11 times, most recently from a7ca3db to 0c0fdfd Compare March 25, 2026 12:56
@renovate renovate bot force-pushed the renovate/npm-dompurify-vulnerability branch 4 times, most recently from 19c2d69 to 63de9f2 Compare March 26, 2026 19:05
@renovate renovate bot changed the title chore(deps): update dependency dompurify to v3.3.2 [security] chore(deps): update dependency dompurify to v3.3.2 [security] - autoclosed Mar 27, 2026
@renovate renovate bot closed this Mar 27, 2026
@renovate renovate bot deleted the renovate/npm-dompurify-vulnerability branch March 27, 2026 02:42
@renovate renovate bot changed the title chore(deps): update dependency dompurify to v3.3.2 [security] - autoclosed chore(deps): update dependency dompurify to v3.3.2 [security] Mar 28, 2026
@renovate renovate bot reopened this Mar 28, 2026
@renovate renovate bot force-pushed the renovate/npm-dompurify-vulnerability branch 2 times, most recently from 63de9f2 to 9494541 Compare March 28, 2026 14:12
@renovate renovate bot changed the title chore(deps): update dependency dompurify to v3.3.2 [security] chore(deps): update dependency dompurify to v3.3.2 [security] - autoclosed Mar 29, 2026
@renovate renovate bot closed this Mar 29, 2026
@renovate renovate bot changed the title chore(deps): update dependency dompurify to v3.3.2 [security] - autoclosed chore(deps): update dependency dompurify to v3.3.2 [security] Mar 30, 2026
@renovate renovate bot reopened this Mar 30, 2026
@renovate renovate bot force-pushed the renovate/npm-dompurify-vulnerability branch 2 times, most recently from 9494541 to fddc3e2 Compare March 30, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants