CVE-2026-40301 rhukster/dom-sanitizer: SVG <style> tag allows CSS injection via unfiltered url() and @import directives
An attacker can inject malicious CSS into sanitized SVGs, causing browsers to make unauthorized requests to attacker-controlled servers.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-40301?
CVE-2026-40301 is a medium-severity cross-site scripting vulnerability in rhukster dom-sanitizer, published on 17 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
DOMSanitizer is a DOM/SVG/MathML Sanitizer for PHP 7.3+. Prior to version 1.0.10, DOMSanitizer::sanitize() allows <style> elements in SVG content but never inspects their text content. CSS url() references and @import rules pass through unfiltered, causing the browser to issue HTTP requests to attacker-controlled hosts when the sanitized SVG is rendered. Version 1.0.10 fixes the issue.
Weakness: CWE-79
Which versions are affected by CVE-2026-40301?
2 open source packages ship an affected version, including rhukster/dom-sanitizer.
| Package | Affected | Fixed in |
|---|---|---|
rhukster/dom-sanitizer Packagist | All versions | 1.0.10 |
rhukster/dom-sanitizer Packagist | All versions | 1.0.10 |
How do I fix CVE-2026-40301?
Upgrade rhukster/dom-sanitizer to 1.0.10 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-40301 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40301 exists.
Sources
Also known as GHSA-93vf-569f-22cq.