CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-CJMM-F4JC-QW8R

GHSA-CJMM-F4JC-QW8R: DOM-based XSS Bypass in DOMPurify via ADD_ATTR Predicate

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 3, 2026·6 min read·43 visits

Executive Summary (TL;DR)

DOMPurify < 3.3.2 skips URI validation for attributes approved via the ADD_ATTR predicate function, allowing DOM-based XSS via malicious protocols.

DOMPurify versions prior to 3.3.2 contain a vulnerability where the ADD_ATTR predicate function short-circuits internal validation logic. This allows dynamically approved attributes to bypass URI-safe sanitization, potentially leading to DOM-based Cross-Site Scripting (XSS) via dangerous protocols like javascript: or data:.

Vulnerability Overview

DOMPurify is an HTML, MathML, and SVG sanitization library designed to prevent DOM-based Cross-Site Scripting (XSS) attacks. It relies on a strict allowlist of elements and attributes, rejecting unrecognized or dangerous input. To support custom application requirements, DOMPurify allows developers to extend this allowlist using configurations such as the ADD_ATTR option.

Recent versions of DOMPurify introduced the ability to pass a predicate function to ADD_ATTR, allowing developers to evaluate attributes dynamically. GHSA-CJMM-F4JC-QW8R identifies a logical flaw in how this predicate function integrates with DOMPurify's internal validation pipeline. When the predicate function approves an attribute, the library skips subsequent mandatory safety checks.

This bypass explicitly affects URI validation. Attributes that require URI sanitization, such as href or src, normally undergo strict protocol checking to block javascript:, vbscript:, or data: payloads. Because the predicate function's approval short-circuits this pipeline, applications dynamically allowing these attributes are exposed to XSS attacks.

Root Cause Analysis

The vulnerability resides within DOMPurify's internal _isValidAttribute function. This function is responsible for analyzing an attribute's name, its associated tag, and its value to determine if it is safe to include in the sanitized Document Object Model (DOM). The validation process involves multiple distinct phases: allowlist checking, hook execution, and URI protocol verification.

When a developer configures ADD_ATTR as a predicate function, DOMPurify evaluates it via the EXTRA_ELEMENT_HANDLING.attributeCheck routine. In vulnerable versions of the library, if this predicate function returns true, the _isValidAttribute function executes an early return. It immediately yields true to the caller, confirming the attribute as safe.

This early return mechanism fundamentally breaks the sanitization pipeline. The URI protocol verification phase occurs later in the _isValidAttribute execution flow. By exiting early, the library never evaluates the attribute's value against the list of prohibited URI schemes. The library operates under the incorrect assumption that the predicate function has already performed comprehensive validation of both the attribute name and its value.

Code Analysis

The flaw stems from a conditional short-circuit in the attribute validation sequence. While the exact patch diff is abstracted in the advisory, the structural logic failure is well-documented. The vulnerable implementation processes the predicate function output and halts further validation upon a positive result.

// Vulnerable internal logic concept
function _isValidAttribute(tag, attrName, attrValue) {
    // ... [allowlist checks] ...
 
    // Predicate function evaluation via ADD_ATTR
    if (config.ADD_ATTR_FUNCTION && config.ADD_ATTR_FUNCTION(attrName, tag)) {
        return true; // EARLY RETURN: Skips all subsequent checks
    }
 
    // ... [mandatory URI validation for href, src, etc.] ...
    if (isURI(attrName)) {
        if (containsDangerousProtocol(attrValue)) {
            return false;
        }
    }
    return true;
}

The remediation requires modifying this logic to decouple allowlist approval from value validation. The patch ensures that predicate functions only authorize the presence of the attribute, not the safety of its contents. The attribute must still pass through the protocol verification phase.

In the patched version (3.3.2), the _isValidAttribute function registers the attribute as permitted by the allowlist but continues execution. The standard URI checks process the attrValue regardless of how the attribute was authorized.

Exploitation

Exploitation of GHSA-CJMM-F4JC-QW8R requires a specific implementation pattern within the target application. The attacker must target an endpoint where DOMPurify sanitizes input using an ADD_ATTR predicate function. Crucially, this predicate function must authorize an attribute capable of executing code (like href) without manually validating the attribute's value.

A typical vulnerable configuration looks like this:

const cleanHTML = DOMPurify.sanitize(userInput, {
    ADD_ATTR: (attrName, tagName) => {
        // Vulnerable: Approves the attribute based solely on name and tag
        return tagName === 'a' && attrName === 'href';
    }
});

An attacker crafts a payload utilizing a dangerous protocol. A standard vector is <a href="javascript:alert(document.domain)">Click Me</a>. When DOMPurify processes this input, the ADD_ATTR predicate evaluates tagName === 'a' and attrName === 'href', returning true.

Because of the vulnerability, DOMPurify skips checking the href value for the javascript: protocol. The resulting cleanHTML retains the malicious payload exactly as input. When the victim interacts with the injected element, the JavaScript executes within the security context of the vulnerable application.

Impact Assessment

The primary impact of this vulnerability is DOM-based Cross-Site Scripting (XSS). Successful exploitation allows an attacker to execute arbitrary JavaScript within the context of the user's session. The severity is constrained only by the requirement for user interaction and the specific DOMPurify configuration employed by the target application.

An attacker achieving XSS can read sensitive data such as session cookies, local storage tokens, and anti-CSRF nonces. They can also perform actions on behalf of the user, modify the Document Object Model to present false information, or exfiltrate sensitive data displayed on the page. The confidentiality and integrity impacts are high for the affected user session.

The CVSS 4.0 vector (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) reflects these characteristics. The attack vector is network-based, requires no privileges, but mandates user interaction (UI:P). The impacts to the vulnerable system itself are negligible, but the subsequent system (the user's browser environment) suffers low to moderate confidentiality and integrity degradation.

Remediation

The definitive mitigation for this vulnerability is upgrading the dompurify package to version 3.3.2 or later. The maintainers (Cure53) have corrected the internal validation logic to ensure that attributes approved via predicate functions still undergo standard URI protocol sanitization. Developers should update their dependency manifests and rebuild their applications.

For environments where immediate upgrading is not feasible, developers must implement manual validation within their ADD_ATTR predicate functions. The predicate must inspect the attribute value and reject dangerous protocols explicitly.

// Interim mitigation strategy
ADD_ATTR: (attrName, tagName, attrValue) => {
    if (tagName === 'a' && attrName === 'href') {
        // Manually block dangerous protocols
        const normalizedValue = attrValue.trim().toLowerCase();
        if (normalizedValue.startsWith('javascript:') || 
            normalizedValue.startsWith('data:') || 
            normalizedValue.startsWith('vbscript:')) {
            return false;
        }
        return true;
    }
    return false;
}

> [!NOTE] > Relying on manual protocol validation is error-prone. The regex and parsing rules for identifying dangerous protocols in HTML are complex. The provided interim code is a baseline defense; upgrading the library is the only comprehensive solution.

Technical Appendix

CVSS Score
5.3/ 10
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

Affected Systems

dompurify (npm package)

Affected Versions Detail

Product
Affected Versions
Fixed Version
dompurify
Cure53
< 3.3.23.3.2
AttributeDetail
CWECWE-79 (Improper Neutralization of Input During Web Page Generation)
Attack VectorNetwork
CVSS Score5.3 (Medium)
ImpactHigh Confidentiality, High Integrity (Session context)
Exploit StatusProof of Concept (PoC) available
User InteractionRequired

MITRE ATT&CK Mapping

T1059.007JavaScript
Execution
T1189Drive-by Compromise
Initial Access
T1539Steal Web Session Cookie
Credential Access
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Vulnerability Timeline

Security advisory published (GHSA-cjmm-f4jc-qw8r).
2026-04-03
DOMPurify version 3.3.2 released with the fix.
2026-04-03
Vulnerability details added to OSV and major vulnerability databases.
2026-04-03

References & Sources

  • [1]Official Advisory
  • [2]GitHub Release
  • [3]OSV Record
  • [4]Vulnerability Database (CIRCL)
  • [5]Aliyun AVD

More Reports

•41 minutes ago•CVE-2026-62988
9.0

CVE-2026-62988: Multi-Factor Authentication and Credential Bypass in Froxlor API

An insecure data retrieval flaw in the Froxlor server administration panel API allows authenticated remote attackers to retrieve unredacted bcrypt password hashes and Base32-encoded Time-Based One-Time Password (TOTP) seeds. Affected endpoints include several 'get' and 'listing' handlers for customers, administrators, and FTP accounts. Utilizing these leaked parameters, attackers can crack the password hashes offline and concurrently generate valid second-factor authentication codes to completely bypass access controls.

Amit Schendel
Amit Schendel
0 views•6 min read
•about 2 hours ago•CVE-2026-70666
7.4

CVE-2026-70666: Server-Side Request Forgery in Netflix Lemur ACME Authority Management

CVE-2026-70666 is a critical Server-Side Request Forgery (SSRF) vulnerability in Netflix Lemur's ACME certificate management integration. Prior to version 1.9.3, the system allowed authority-role users to bypass initial ACME URL allowlist validations when updating an existing authority. Additionally, the underlying ACME network client blindly parsed and connected to dynamic endpoint URLs supplied in JSON responses from the configured ACME directory, allowing attackers to route arbitrary JWS-signed requests to internal services or cloud metadata endpoints.

Alon Barad
Alon Barad
1 views•5 min read
•about 3 hours ago•CVE-2026-70667
6.3

CVE-2026-70667: Server-Side Request Forgery Bypass in Netflix Lemur Certificate Verification

A security vulnerability in Netflix Lemur, a TLS certificate management framework, allows authenticated operators to bypass Server-Side Request Forgery (SSRF) mitigations. The issue exists within the certificate revocation verification workflow, specifically inside the CRL and OCSP retrieval logic. By exploiting HTTP redirects or DNS rebinding (Time-of-Check Time-of-Use) mechanisms, an attacker can coerce the server into issuing arbitrary network requests to internal services, such as the cloud instance metadata service (IMDS) or loopback addresses. This bypass neutralizes previous network-boundary validation logic and allows blind read/write SSRF targeting internal infrastructure resources.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 4 hours ago•CVE-2026-71303
7.7

CVE-2026-71303: Server-Side Request Forgery Bypass in Netflix Lemur Authority Updates

Netflix Lemur, an open-source TLS certificate management framework, is affected by a Server-Side Request Forgery (SSRF) vulnerability. This vulnerability arises from an incomplete patch for a previous security flaw, CVE-2026-55166. While Lemur version 1.9.2 validated the ACME directory URL against an allowlist during authority creation, it failed to perform the same checks when updating existing authorities. An authenticated user possessing an authority role can exploit this omission to replace the directory URL with internal or cloud metadata endpoints. During subsequent certificate issuance, the Lemur backend executes unauthorized requests, potentially leaking sensitive metadata or credentials.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 5 hours ago•CVE-2026-71307
7.7

CVE-2026-71307: Plaintext Credential Exposure in Netflix Lemur Destinations API

An authorization bypass and information disclosure vulnerability in Netflix Lemur before version 1.9.3 allows authenticated, low-privilege users to retrieve raw destination configurations, exposing plaintext credentials such as SFTP passwords and private key passphrases.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 6 hours ago•CVE-2026-71308
8.1

CVE-2026-71308: Missing Authorization and Lifecycle Hijacking in Netflix Lemur

Netflix Lemur before 1.9.3 contains a missing authorization vulnerability (CWE-862, CWE-639) when handling certificate creation, upload, or modification. Authenticated non-read-only users can manipulate the replaces parameter to silence expiration notifications and hijack certificate rotation tasks for arbitrary targets, leading to unauthorized TLS certificate deployment and traffic interception.

Alon Barad
Alon Barad
8 views•7 min read