<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>DOMPurify - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/dompurify/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 23 Jul 2026 14:23:17 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/dompurify/feed.xml" rel="self" type="application/rss+xml"/><item><title>CVE-2026-65898: DOMPurify Vulnerability Leads to Stored Cross-Site Scripting</title><link>https://feed.craftedsignal.io/briefs/2026-07-cve-2026-65898-dompurify-xss/</link><pubDate>Thu, 23 Jul 2026 14:23:17 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-cve-2026-65898-dompurify-xss/</guid><description>A vulnerability in DOMPurify before version 3.4.11 allows attackers to achieve stored Cross-Site Scripting (XSS) by manipulating the `ALLOWED_ATTR` allowlist through an `uponSanitizeAttribute` hook, leading to client-side code execution.</description><content:encoded><![CDATA[<p>CVE-2026-65898 describes a significant security flaw in the DOMPurify JavaScript library, affecting versions prior to 3.4.11. This vulnerability arises because <code>DOMPurify</code> fails to properly clone the <code>ALLOWED_ATTR</code> allowlist when the <code>setConfig()</code> method is used in conjunction with an <code>uponSanitizeAttribute</code> hook. This oversight permits an attacker to register a malicious hook that can permanently mutate the global <code>ALLOWED_ATTR</code> allowlist. Consequently, dangerous attributes, such as <code>onerror</code>, can be conditionally allowed for otherwise trusted HTML elements. This paves the way for attackers to submit untrusted content that leverages the polluted allowlist, enabling the execution of event handlers and ultimately leading to stored Cross-Site Scripting (XSS) attacks in affected web applications. This vulnerability poses a risk to web applications that rely on <code>DOMPurify</code> for sanitization, potentially compromising user data and application integrity.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a web application utilizing DOMPurify versions prior to 3.4.11 and the <code>setConfig()</code> method with an <code>uponSanitizeAttribute</code> hook.</li>
<li>The attacker injects malicious client-side script into the application, which registers a crafted <code>uponSanitizeAttribute</code> hook with the DOMPurify instance.</li>
<li>This malicious hook exploits the cloning failure to permanently modify the shared <code>ALLOWED_ATTR</code> allowlist, adding dangerous attributes like <code>onerror</code> to the list for specific trusted HTML elements under certain conditions.</li>
<li>The attacker then submits a second payload of untrusted content (e.g., an HTML snippet in a comment or post). This content includes a seemingly trusted HTML element containing one of the newly allowed dangerous attributes (e.g., <code>&lt;img src=&quot;x&quot; onerror=&quot;alert(document.cookie)&quot;&gt;</code>).</li>
<li>When a victim's browser attempts to render this content, DOMPurify sanitizes it using the now-polluted <code>ALLOWED_ATTR</code> allowlist, which permits the dangerous attribute to remain.</li>
<li>The dangerous attribute's event handler (e.g., <code>onerror</code>) then executes in the victim's browser, leading to client-side code execution, typically as stored Cross-Site Scripting (XSS).</li>
<li>The XSS payload can then perform actions such as session hijacking, data exfiltration, defacement, or redirection, impacting the integrity and confidentiality of the web application and its users.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The successful exploitation of CVE-2026-65898 can lead to severe consequences for web applications and their users, rated with a CVSS v3.1 Base Score of 7.2 (High). Stored Cross-Site Scripting (XSS) allows attackers to inject malicious scripts into a web application, which are then executed in the browsers of other users who view the compromised content. This can result in session hijacking, enabling attackers to impersonate legitimate users and access sensitive information. It can also lead to data theft, website defacement, redirection to malicious sites, or the delivery of drive-by downloads. The integrity and confidentiality of user data, including credentials and personal information, are at high risk. Any web application that relies on DOMPurify for content sanitization and uses the affected configuration is vulnerable, potentially exposing a broad user base to these client-side attacks.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Update DOMPurify to version 3.4.11 or later immediately to address CVE-2026-65898.</li>
<li>Review all instances where <code>DOMPurify.setConfig()</code> is used with an <code>uponSanitizeAttribute</code> hook to ensure that any custom logic does not inadvertently introduce similar attribute allowlist pollution even after updating the library.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>xss</category><category>javascript</category><category>web-vulnerability</category><category>client-side</category></item></channel></rss>