CVE-2026-65903
mediumpriority · track · 0EPSS 0.003 · 25 %ileEUUSEPSS · scored 2026-10-27
DOMPurify before 3.4.0 contains a logic error in the ADD_TAGS function where short-circuit evaluation allows forbidden tags to bypass FORBID_TAGS restrictions. Attackers can craft input containing tags listed in FORBID_TAGS that are also added via ADD_TAGS function, causing them to be retained in sanitized output.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · low–medium · 1.2–6.1
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (3)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-39q2-94rc-95cpDOMPurify's ADD_TAGS function form bypasses FORBID_TAGS due to short-circuit evaluation2026-04-16ghsa · osvUS
## Summary In `src/purify.ts:1117-1123`, `ADD_TAGS` as a function (via `EXTRA_ELEMENT_HANDLING.tagCheck`) bypasses `FORBID_TAGS` due to short-circuit evaluation. The condition: ``` !(tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) ``` When `tagCheck(tagName)` returns `true`, the entire condition is `false` and the element is kept — `FORBID_TAGS[tagName]` is never evaluated. ## Inconsistency This contradicts the attribute-side pattern at line 1214 where `FORBID_ATTR` explicitly wins first: ``` if (FORBID_ATTR[lcName]) { continue; } ``` For tags, FORBID should also take precedence over ADD. ## Impact Applications using both `ADD_TAGS` as a function and `FORBID_TAGS` simultaneously get unexpected behavior — forbidden tags are allowed through. Config-dependent but a genuine logic inconsistency. ## Suggested Fix Check `FORBID_TAGS` before `tagCheck`: ``` if (FORBID_TAGS[tagName]) { /* remove */ } else if (tagCheck(tagName) || ALLOWED_TAGS[tagName]) { /* keep */ } ``` ## Affected Version v3.3.3 (commit 883ac15)
also known as (2)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (6)
External citations — patches, advisories, analysis.
- https://github.com/cure53/DOMPurify/security/advisories/GHSA-39q2-94rc-95cpcnnvd
- https://www.vulncheck.com/advisories/dompurify-before-add-tags-function-bypasses-forbid-tagscnnvd
- https://github.com/cure53/DOMPurify/security/advisories/GHSA-39q2-94rc-95cpenisa_euvd
- https://www.vulncheck.com/advisories/dompurify-before-add-tags-function-bypasses-forbid-tagsenisa_euvd
- https://github.com/cure53/DOMPurify/security/advisories/GHSA-39q2-94rc-95cpExploitThird Party Advisorynvd
- https://www.vulncheck.com/advisories/dompurify-before-add-tags-function-bypasses-forbid-tagsThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan