GHSA-cjmm-f4jc-qw8r

Suggest an improvement
Source
https://github.com/advisories/GHSA-cjmm-f4jc-qw8r
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-cjmm-f4jc-qw8r/GHSA-cjmm-f4jc-qw8r.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cjmm-f4jc-qw8r
Downstream
Related
Published
2026-04-03T03:46:07Z
Modified
2026-04-07T18:44:11.938759722Z
Severity
  • 5.3 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N CVSS Calculator
Summary
DOMPurify ADD_ATTR predicate skips URI validation
Details

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).

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-03T03:46:07Z",
    "nvd_published_at": null,
    "severity": "MODERATE",
    "cwe_ids": [
        "CWE-183"
    ]
}
References

Affected packages

npm / dompurify

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.3.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-cjmm-f4jc-qw8r/GHSA-cjmm-f4jc-qw8r.json"
last_known_affected_version_range
"<= 3.3.1"