Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-100370 Overview
CVE-2026-100370 is an input validation vulnerability [CWE-20] in DOMSanitizer, a DOM/SVG/MathML sanitizer library for PHP 7.3+. The flaw resides in the isDangerousUrl() method, which rejects javascript: schemes outright but only blocks data: URLs when the literal substring onload is present. Because data: payloads are typically Base64-encoded, malicious markup such as <script> tags and event handlers bypass the substring check. An attacker can craft a data:text/html;base64,… URL that survives sanitization in href and xlink:href attributes, enabling cross-site scripting when the decoded content is rendered. The maintainer patched the issue in version 1.0.15.
Critical Impact
Base64-encoded data: URLs in href and xlink:href attributes bypass the sanitizer and can execute active markup in the victim's browser after user interaction.
Affected Products
- DOMSanitizer for PHP (rhukster/dom-sanitizer)
- All versions prior to 1.0.15
- PHP 7.3+ applications embedding the library for DOM, SVG, or MathML sanitization
Discovery Timeline
- 2026-09-28 - CVE-2026-100370 published to the National Vulnerability Database
- 2026-09-30 - Last updated in NVD database
Technical Details for CVE-2026-100370
Vulnerability Analysis
DOMSanitizer's isDangerousUrl() method enforces two rules for URL-bearing attributes. It rejects any value beginning with javascript:, and it rejects data: values matching the regular expression /^data:.*onload/i. The second rule assumes malicious data: payloads carry the literal word onload in cleartext. That assumption fails against Base64-encoded payloads, which are the standard representation for data:text/html and data:image/svg+xml content.
A URL such as data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg== decodes to <script>alert(1)</script> but contains no visible onload substring. The sanitizer passes it through unchanged. When a browser navigates to the surviving href, the decoded HTML executes in the origin of the rendering document, producing cross-site scripting. The xlink:href attribute inside SVG offers the same primitive.
Root Cause
The defect is an incomplete input validation check [CWE-20]. The sanitizer inspects the raw URL string for a keyword instead of decoding the payload or enforcing a scheme allowlist. Any transformation that hides the keyword, including Base64, URL encoding, or whitespace insertion, defeats the filter.
Attack Vector
Exploitation requires an attacker to supply markup that reaches DOMSanitizer and later gets rendered to a victim. A victim must load the sanitized document and interact with the malicious link. Because the payload is delivered client-side, no authentication is needed at the sanitizer boundary, though scope is limited to what the surrounding application allows.
// Patch from version 1.0.15 - adds SNEAKY_DATA_URL constant
const EXTERNAL_URL = "/url\s*\(\s*[\"']?\s*(ftp:\/\/|http:\/\/|https:\/\/|\/\/|data:)/i";
const JAVASCRIPT_ATTR = "/(\s(?:href|xlink\:href)\s*=\s*\"javascript:.*?\")/i";
const SNEAKY_ONLOAD = "/(\s(?:href|xlink\:href)\s*=\s*\"data:.*onload.*?\")/i";
// Belt-and-braces for the post-serialization pass: any `data:` href whose
// declared MIME is not an inert image type is stripped, mirroring the
// scheme-level policy in isDangerousUrl(). (GHSA-wcj2-r6vg-rm97)
const SNEAKY_DATA_URL = "/(\s(?:href|xlink\:href)\s*=\s*\"data:(?!image\/(?:png|jpe?g|gif|webp|bmp|x-icon|vnd\.microsoft\.icon)[;,])[^\"]*\")/i";
const NAMESPACE_TAGS = '/xmlns[^=]*="[^"]*"/i';
Source: GitHub Commit Fix. The fix adds a SNEAKY_DATA_URL regex that strips any data: URL in href or xlink:href unless it declares an inert image MIME type such as image/png or image/jpeg.
Detection Methods for CVE-2026-100370
Indicators of Compromise
- Stored content containing href="data:text/html" or href="data:application/xhtml+xml" values
- SVG documents with xlink:href attributes referencing data: URLs that are not image/* MIME types
- Base64-encoded strings in URL attributes that decode to markup containing <script>, <iframe>, or event handlers
Detection Strategies
- Scan stored content and templates for data: URLs in href and xlink:href attributes, then Base64-decode the payload and inspect the result
- Audit application dependencies for rhukster/dom-sanitizer versions below 1.0.15 using composer manifests and lockfiles
- Add regression tests using Base64-encoded data:text/html payloads against the sanitizer output
Monitoring Recommendations
- Log outbound and rendered anchor navigations to data: schemes at the browser or proxy layer
- Alert on Content Security Policy violations related to inline scripts and data: navigations
- Track composer dependency updates so dom-sanitizer upgrades are applied across all consuming services
How to Mitigate CVE-2026-100370
Immediate Actions Required
- Upgrade rhukster/dom-sanitizer to version 1.0.15 or later via composer update
- Re-sanitize any stored user content that was processed by an earlier version of the library
- Enforce a strict Content Security Policy that blocks navigation to data: URLs where feasible
Patch Information
The fix ships in DOMSanitizer 1.0.15, published on GitHub. It introduces a SNEAKY_DATA_URL regex that removes any data: value in href or xlink:href whose MIME type is not on the inert image allowlist (png, jpeg, gif, webp, bmp, x-icon, vnd.microsoft.icon). Reference the GitHub Release Version 1.0.15 and GitHub Security Advisory GHSA-wcj2-r6vg-rm97 for details.
Workarounds
- Pre-filter user-supplied HTML to reject any data: scheme in URL attributes before passing content to the sanitizer
- Apply a Content Security Policy directive such as navigate-to 'self' or a restrictive default-src to block data: navigations
- Post-process sanitizer output with an additional regex that strips href and xlink:href attributes referencing non-image data: MIME types
# Upgrade the library via Composer
composer require rhukster/dom-sanitizer:^1.0.15
composer update rhukster/dom-sanitizer
# Verify installed version
composer show rhukster/dom-sanitizer | grep versions
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

