# CVE-2026-0540: DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML

- Severity: Medium 5.3 (CVSS:4.0, scored by VulnCheck) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/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.38%, higher than 34% of CVEs (2026-12-02)
- Published: 2026-03-03T17:26:06.621Z
- Modified: 2026-09-10T03:50:41.055Z
- Also known as: GHSA-v2wj-7wpq-c8vv
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: VulnCheck

## Description

DOMPurify 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8, fixed in commit 2726c74, contain a cross-site scripting vulnerability that allows attackers to bypass attribute sanitization by exploiting five missing rawtext elements (noscript, xmp, noembed, noframes, iframe) in the SAFE_FOR_XML regex. Attackers can include payloads like </noscript><img src=x onerror=alert(1)> in attribute values to execute JavaScript when sanitized output is placed inside these unprotected rawtext contexts.

(As written by CVE List.)

## Affected

- cure53 DOMPurify: from 3.1.3 up to 3.3.1; from 2.5.3 up to 2.5.8
- dompurify (npm): from 3.1.3 before 3.3.2; from 2.5.3 before 2.5.9

## Every score

- VulnCheck: CVSS:4.0 5.3 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`
- VulnCheck: 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`
- GitHub: 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`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`

## References

- <https://github.com/cure53/DOMPurify> (package, product)
- <https://github.com/cure53/DOMPurify/commit/302b51de22535cc90235472c52e3401bedd46f80> (patch, web)
- <https://github.com/cure53/DOMPurify/releases/tag/3.3.2> (release-notes, web)
- <https://fluidattacks.com/advisories/daft> (third-party-advisory, web)
- <https://www.vulncheck.com/advisories/dompurify-xss-via-missing-rawtext-elements-in-safe-for-xml> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-0540> (advisory)
- <https://github.com/cure53/DOMPurify/commit/fca0a938b4261ddc9c0293a289935a9029c049f5> (web)

## Sources

- CVE List: [CVE-2026-0540](https://www.cve.org/CVERecord?id=CVE-2026-0540), CVE Terms of Use, modified 2026-03-25
- GitHub Advisory Database: [GHSA-v2wj-7wpq-c8vv](https://github.com/advisories/GHSA-v2wj-7wpq-c8vv), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-0540](https://nvd.nist.gov/vuln/detail/CVE-2026-0540), Public domain, modified 2026-06-17

---

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