Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. dompurify
  4. ›
  5. GHSA-cjmm-f4jc-qw8r

GHSA-cjmm-f4jc-qw8r: DOMPurify ADD_ATTR predicate skips URI validation

April 3, 2026

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.

References

  • github.com/advisories/GHSA-cjmm-f4jc-qw8r
  • github.com/cure53/DOMPurify
  • github.com/cure53/DOMPurify/releases/tag/3.3.2
  • github.com/cure53/DOMPurify/security/advisories/GHSA-cjmm-f4jc-qw8r

Code Behaviors & Features

Detect and mitigate GHSA-cjmm-f4jc-qw8r with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.3.2

Fixed versions

  • 3.3.2

Solution

Upgrade to version 3.3.2 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-183: Permissive List of Allowed Inputs

Source file

npm/dompurify/GHSA-cjmm-f4jc-qw8r.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:18:28 +0000.