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-103687 Overview
CVE-2026-103687 affects the rhukster dom-sanitizer PHP library through version 1.0.15. The vulnerability resides in the url function within src/DOMSanitizer.php, part of the SVG Sanitization component. An incomplete blacklist (CWE-183) in external URL detection allows attackers to bypass sanitization by hiding url() values behind CSS comments or hexadecimal escapes. These crafted values evade the raw regex check but are still decoded by the browser's CSS tokenizer, resulting in a live external reference. The exploit has been publicly disclosed. Upgrading to version 1.0.16 resolves the issue through commit 139c46c3d7c9bc81542b7b5a58d5cde5d0e0195a.
Critical Impact
Attackers can bypass SVG sanitization to inject external references through CSS url() values in presentation attributes, enabling data exfiltration and content injection via sanitized SVG content.
Affected Products
- rhukster dom-sanitizer versions up to and including 1.0.15
- Applications embedding dom-sanitizer for SVG content processing
- PHP projects using src/DOMSanitizer.php for user-supplied SVG
Discovery Timeline
- 2026-10-01 - CVE-2026-103687 published to the National Vulnerability Database (NVD)
- 2026-10-01 - Last updated in NVD database
- Patch commit - 139c46c3d7c9bc81542b7b5a58d5cde5d0e0195a released in version 1.0.16
Technical Details for CVE-2026-103687
Vulnerability Analysis
The flaw is an incomplete blacklist (CWE-183) in the isExternalUrl() method of src/DOMSanitizer.php. The function used a regular expression (EXTERNAL_URL) to detect external references in SVG presentation attributes such as fill, stroke, filter, clip-path, mask, and marker-*. These attributes accept CSS url() values. A CSS comment or hex escape placed between url( and the scheme defeats the raw regex check. Browsers, however, decode these constructs during CSS tokenization and resolve the external reference at render time. The discrepancy between the sanitizer regex and the browser parser allows malicious SVG payloads to pass validation while still fetching attacker-controlled content.
Root Cause
The sanitizer compared raw attribute values against a regex instead of first normalizing CSS syntax. Inline <style> paths already normalized content before checks, but presentation attribute paths did not. This parser-differential enabled bypass through CSS obfuscation techniques that are semantically equivalent to a direct url() reference once the browser decodes them.
Attack Vector
Exploitation is remote and requires no authentication or user interaction. An attacker supplies crafted SVG content containing presentation attributes with obfuscated url() values. When a vulnerable application sanitizes and renders the SVG, the browser decodes the CSS, resolving the external reference the sanitizer failed to catch. This can enable content injection, external resource loading, and limited information disclosure through referrer leakage or callback requests.
/**
* Determines if the attribute value is an external link
*
* SVG presentation attributes (fill, stroke, filter, clip-path, mask,
* marker-*) carry CSS url() values, and a CSS comment or hex escape placed
* between `url(` and the scheme defeats a raw regex match while the
* browser's CSS tokenizer still decodes it into a live external reference.
* The <style>/style paths already normalize before their checks, so the
* same normalizer runs here, making every url()-carrying attribute agree.
* (GHSA-cjfg-j8jp-5xvc)
*
* @param $attr_value
* @return bool
*/
protected function isExternalUrl($attr_value): bool
{
return preg_match(self::EXTERNAL_URL, $this->normalizeCss((string) $attr_value));
}
Source: GitHub Commit 139c46c3
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-103687
Indicators of Compromise
- SVG files containing presentation attributes (fill, stroke, filter, clip-path, mask, marker-*) with url() values wrapped in CSS comments like url(/*x*/http://...)
- Hex-escaped characters appearing inside url() values within SVG attributes, for example url(\68 ttp://...)
- Outbound HTTP requests from rendered SVG content to unexpected third-party domains
Detection Strategies
- Perform dependency inventory to identify applications using rhukster dom-sanitizer at or below version 1.0.15
- Scan stored SVG uploads for CSS comment sequences (/*, */) or backslash-hex escapes inside presentation attribute values
- Deploy Content Security Policy (CSP) with default-src 'self' to log and block unexpected external resource loads from rendered SVGs
Monitoring Recommendations
- Monitor web server and proxy logs for CSP violation reports originating from pages that render user-supplied SVG
- Track egress DNS and HTTP requests tied to SVG rendering workflows, especially from browser clients loading sanitized content
- Alert on unexpected modifications to src/DOMSanitizer.php or Composer dependency pins for rhukster/dom-sanitizer
How to Mitigate CVE-2026-103687
Immediate Actions Required
- Upgrade rhukster/dom-sanitizer to version 1.0.16 or later using Composer: composer require rhukster/dom-sanitizer:^1.0.16
- Audit stored SVG content for payloads matching the obfuscation patterns described in GHSA-cjfg-j8jp-5xvc
- Re-sanitize existing SVG assets after upgrading to ensure previously accepted payloads are revalidated
Patch Information
The fix is implemented in commit 139c46c3d7c9bc81542b7b5a58d5cde5d0e0195a and ships in release 1.0.16. The patch routes attribute values through normalizeCss() before the external URL regex check, aligning presentation attribute handling with the existing <style> path. Reference the GitHub Release Tag 1.0.16 and the GitHub Security Advisory GHSA-cjfg-j8jp-5xvc for complete details.
Workarounds
- Reject SVG uploads containing CSS comment sequences or backslash-hex escapes within attribute values until the patch is applied
- Serve user-supplied SVGs from a sandboxed origin with a strict CSP that disables external resource loading
- Strip SVG presentation attributes (fill, stroke, filter, clip-path, mask, marker-*) in a preprocessing layer when they contain url( substrings
# Upgrade dom-sanitizer to the patched release
composer require rhukster/dom-sanitizer:^1.0.16
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

