# CVE-2026-41240: DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)

- Severity: Medium 6.0 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.33%, higher than 27% of CVEs (2026-12-02)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-22T17:34:17.000Z
- Modified: 2026-10-26T21:10:00.170Z
- Also known as: GHSA-h7mw-gpvr-xq4m
- Weaknesses: CWE-79, CWE-183
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions prior to 3.4.0 have an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used. Commit c361baa added an early exit for FORBID_ATTR at line 1214. 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. This allows forbidden elements to survive sanitization with their attributes intact. Version 3.4.0 patches the issue.

(As written by CVE List.)

## Affected

- cure53 DOMPurify: < 3.4.0; before 3.4.0
- dompurify (npm): before 3.4.0

## Every score

- GitHub_M: CVSS:4.0 6.0 Medium `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m> (exploit, mitigation, patch, vendor-advisory, web)
- <https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80> (patch, web)
- <https://github.com/cure53/DOMPurify/releases/tag/3.4.0> (product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-41240> (advisory)
- <https://github.com/cure53/DOMPurify> (package)

## Sources

- CVE List: [CVE-2026-41240](https://www.cve.org/CVERecord?id=CVE-2026-41240), CVE Terms of Use, modified 2026-04-23
- GitHub Advisory Database: [GHSA-h7mw-gpvr-xq4m](https://github.com/advisories/GHSA-h7mw-gpvr-xq4m), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-41240](https://nvd.nist.gov/vuln/detail/CVE-2026-41240), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-41240 · Whole record: https://cve.day/CVE-2026-41240.json · Rebuilt by cve.day 2026-11-25T22:59:19.393Z
