CVE-2026-65903
DOMPurify's ADD_TAGS function form bypasses FORBID_TAGS due to short-circuit evaluation
Description
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)
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » dompurifyvia npm dompurify | < 3.4.0 | 3.4.0 |
| org.webjars.npm » dompurifyvia npm dompurify | < 3.4.0 | 3.4.0 |
Blast radius
33% of the dependent artifacts (17) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 181 |
| 2 hops | 558 |
| 3 hops | 429 |
| 4 hops | 130 |
| 5 hops | 120 |
Most used dependents
- org.mvnpm.at.bigbinary » neeto-commons-frontend14 usages
- org.webjars.npm » monaco-editor9 usages
- org.eclipse.dirigible » dirigible-components-ui-editor-monaco8 usages
- org.eclipse.dirigible » dirigible-components-ui-view-sql8 usages
- org.eclipse.dirigible » dirigible-components-group-ide7 usages
- org.mvnpm » monaco-editor7 usages
- org.mvnpm.at.bigbinary » neeto-atoms7 usages
- org.mvnpm.at.bigbinary » neeto-molecules6 usages
- org.mvnpm.at.bigbinary » neeto-filters-frontend6 usages
- org.mvnpm » mermaid5 usages
- org.mvnpm.at.bigbinary » neeto-team-members-frontend4 usages
- org.mvnpm.at.lwrjs » core4 usages
- org.mvnpm.at.bigbinary » neeto-image-uploader-frontend4 usages
- org.mvnpm.at.bigbinary » neeto-editor4 usages
- org.mvnpm.at.locker » html-sanitizer3 usages
Computed from the dependency graph of build 20261125.2201 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Package | cure53/DOMPurify | github.com |
| Web | cure53/DOMPurify advisory GHSA-39q2-94rc-95cp | github.com |
