Description
DOMSanitizer is a DOM/SVG/MathML Sanitizer for PHP 7.3+. Prior to version 1.0.15, the isDangerousUrl() method is responsible for rejecting dangerous URL values in the href and xlink:href attributes. The weakness is that "javascript:" is rejected as a scheme, while "data:" is rejected only when the literal substring onload appears in the URL value (/^data:.*onload/i). Because data: payloads are routinely Base64-encoded, the dangerous content (<script>, event handlers, etc.) is invisible to that substring test. A URL such as data:text/html;base64,… therefore survives in href / xlink:href, even though the decoded payload is active markup. This is an incomplete input-validation / sanitization defect in the sanitizer itself. This issue has been patched in version 1.0.15.
References5
- github.com/rhukster/dom-sanitizer/commit/10f97807e4501d60f63987…
- github.com/rhukster/dom-sanitizer/commit/fb8f758b41134fc5fb2f56…
- github.com/rhukster/dom-sanitizer/releases/tag/1.0.15
- github.com/rhukster/dom-sanitizer/security/advisories/GHSA-wcj2…
- github.com/rhukster/dom-sanitizer/security/advisories/GHSA-wcj2…
Metrics
- CVSS 3.1
-
4.7
MEDIUM
Score source: CNA
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - EPSS — exploit probability
- 0% percentile: 20 · as of 9 November 2026
- CWE
- CWE-20
Could this be exploited in your environment?
A patch closes the known hole. A penetration test shows what an attacker can still reach — with proof.