{"id":"CVE-2026-0540","summary":"DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML","details":"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 \u003c/noscript\u003e\u003cimg src=x onerror=alert(1)\u003e in attribute values to execute JavaScript when sanitized output is placed inside these unprotected rawtext contexts.","aliases":["GHSA-v2wj-7wpq-c8vv"],"modified":"2026-08-12T03:51:09.363750369Z","published":"2026-03-03T17:26:06.621Z","related":["CGA-wcqm-jq92-cx5v","openSUSE-SU-2026:10599-1"],"database_specific":{"cna_assigner":"VulnCheck","cwe_ids":["CWE-79"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/0xxx/CVE-2026-0540.json"},"references":[{"type":"ADVISORY","url":"https://fluidattacks.com/advisories/daft"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/0xxx/CVE-2026-0540.json"},{"type":"ADVISORY","url":"https://github.com/cure53/DOMPurify/releases/tag/3.3.2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-0540"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/dompurify-xss-via-missing-rawtext-elements-in-safe-for-xml"},{"type":"FIX","url":"https://github.com/cure53/DOMPurify/commit/302b51de22535cc90235472c52e3401bedd46f80"},{"type":"PACKAGE","url":"https://github.com/cure53/DOMPurify"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/cure53/dompurify","events":[{"introduced":"e1ddfc7b5e6d6599c369f826699b0204e2c691b9"},{"last_affected":"ee992fc4880215757c9c09e9638bb95e1dc24533"},{"introduced":"3fe78d7501103832166613bb1452985dd4674008"},{"fixed":"302b51de22535cc90235472c52e3401bedd46f80"},{"fixed":"5e56114cb24079ce52dbc51f76e494b77afa5153"}],"database_specific":{"cpe":"cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*","extracted_events":[{"introduced":"2.5.3"},{"last_affected":"2.5.8"},{"introduced":"3.1.3"},{"last_affected":"3.3.1"}],"source":["CPE_RANGE","REFERENCES"]}}],"versions":["2.5.8","3.2.3","2.5.7","2.5.6","2.5.5","2.5.4","2.5.3","3.1.3"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-0540.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}