PHP
CVE-2026-40301
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker crafts SVG with malicious CSS
-
DeliveryAttacker uploads SVG to application accepting user content
-
ExploitApplication sanitizes SVG with vulnerable DOMSanitizer
-
InstallSanitized SVG returned to victim's browser
-
C2Browser renders SVG and processes <style> element
-
ExecuteBrowser fetches attacker's URL via CSS url()
-
ImpactAttacker receives request with victim's session metadata
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The vulnerability requires that (1) an attacker can supply or influence SVG content that is sanitized by a vulnerable version of DOMSanitizer, and (2) the sanitized SVG is rendered in a web browser (or any user agent that processes CSS). No special library configuration is required - the default behavior of DOMSanitizer::sanitize() permits <style> elements without inspection. Authentication is not required from the attacker's perspective; any unauthenticated user who can upload or inject SVG content can exploit this. However, the victim must have an active session or credentials that the attacker wishes to leak, and the victim's browser must render the SVG (which is the normal behavior for SVG display in HTML or as standalone files). The vulnerability does NOT affect applications that: (a) disable SVG rendering entirely, (b) re-sanitize SVG content after upgrading to version 1.0.10, (c) serve SVG content with Content-Security-Policy headers that restrict image-src or script-src, or (d) strip <style> elements from SVG before sanitization. Exploitation is NOT limited to any specific PHP version or operating system - the vulnerability exists wherever the vulnerable library is used. |
| Impact | The CVSS score of 4.7 (Low-to-Medium severity) reflects the requirements for user interaction and limited direct confidentiality impact, but this underrepresents the real-world risk in several scenarios. Exploitation is guaranteed if SVG content is user-supplied and rendered; the AC:L and UI:R indicate the attack is straightforward once an attacker-controlled SVG reaches a victim's browser. The scope change (S:C) signals the vulnerability affects not just the vulnerable application but also other users or resources accessed by the victim's browser session. However, several mitigating factors reduce practical exploitation likelihood: (1) an attacker must control SVG input or influence its delivery, (2) the SVG must be rendered in a context where the browser processes CSS (some HTML renderers or email clients may disable CSS in images), and (3) the attacker can only observe side-channel signals (request metadata), not exfiltrate arbitrary data. The vulnerability is not actively exploited at scale (no CISA KEV listing or public POC identified), but the fix is available and straightforward, reducing deployment lag. For applications accepting user-supplied SVG (e.g., design tools, content management systems, image upload features), this is a HIGH priority despite the Low-Medium CVSS, because SVG rendering is difficult to disable without breaking legitimate functionality. For applications only sanitizing internal or fully-trusted SVG, risk is LOW. |
| Exploit ScenarioDerived | An attacker uploads a malicious SVG file to a content management system or design platform using DOMSanitizer to sanitize it. The SVG contains a <style> element with a CSS rule like |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 17, 2026
DOMSanitizer before version 1.0.10 fails to sanitize CSS content within SVG <style> elements, allowing attackers to inject url() references and @import rules that trigger unauthorized HTTP requests to attacker-controlled hosts when the sanitized SVG is rendered in a browser. This affects PHP applications using the vulnerable library to sanitize user-supplied SVG content, enabling information disclosure through request metadata and potential CSRF attacks. The vulnerability requires user interaction (rendering the SVG) but affects all downstream users of the sanitized content due to scope change (C:L, S:C).
RemediationAI
Upgrade DOMSanitizer to version 1.0.10 or later immediately. Update the Composer dependency with composer update rhukster/dom-sanitizer to pull the patched version. The fix inspects and sanitizes CSS content within SVG <style> elements, filtering url() and @import rules. If immediate upgrade is infeasible, implement a temporary compensating control: strip all <style> elements from SVG content before passing to DOMSanitizer (trade-off: legitimate SVG styling will be lost), or disable rendering of user-supplied SVG entirely pending patching. For applications that must accept user SVG and preserve styling, validate CSS rules against a strict allowlist before rendering (e.g., forbid url() and @import, allow only primitive properties like fill, stroke, opacity). Monitor composer.lock for DOMSanitizer version and enable automated dependency updates or security alerts via GitHub Dependabot.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
DOMSanitizer is a PHP library designed to sanitize DOM, SVG, and MathML content by removing potentially dangerous elements and attributes. The vulnerability exists in the sanitization logic for SVG <style> elements, which the library permits but does not inspect for CSS rules that can trigger network requests. CSS url() functions in properties like background-image, and @import rules within <style> blocks, are processed by browsers as absolute resource references regardless of origin. When a browser renders the sanitized SVG, it automatically fetches these resources, causing side-channel information leakage (via HTTP request parameters, referer headers, cookies) and enabling CSRF attacks against authenticated sessions. The root cause is inadequate input validation (CWE-79: Improper Neutralization of Input During Web Page Generation, also known as Cross-site Scripting). The library's allowlist approach for SVG elements included <style> but lacked corresponding inspection of its text content.
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Affected Products (CPE)CVE.org
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB