Description
PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. In versions 4.0.0 through 5.8.0, 3.3.0 through 3.10.6, 2.2.0 through 2.4.6, 2.0.0 through 2.1.17, and all releases up to and including 1.30.5, the WEBSERVICE() domain whitelist can be bypassed via an HTTP redirect (SSRF). In Calculation/Web/Service.php, the webService() method validates a URL's host against the whitelist set via Spreadsheet::setDomainWhiteList(), then fetches content with file_get_contents($url, false, $ctx); because PHP's HTTP stream wrapper follows 301/302 redirects automatically (up to 20 hops) and the redirect target is never re-validated, an attacker who can trigger a redirect from a whitelisted domain can reach arbitrary URLs, including internal addresses. An attacker able to upload XLSX files to an application that uses setDomainWhiteList() and getCalculatedValue() can achieve a full-read SSRF, returning up to 32,767 bytes of the response body as a cell's calculated value, which enables exfiltration of cloud metadata (AWS/GCP/Azure credentials via http://169.254.169.254/), access to internal-only services, and internal port scanning (the port is not validated). This issue has been fixed in versions 5.8.1, 3.10.7, 2.4.7, 2.1.18, and 1.30.6.
Published: 2026-07-28
Score: 7.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

PhpSpreadsheet allows a Server Side Request Forgery (SSRF) when the WEBSERVICE() function is used with a URL that belongs to a whitelisted domain but then redirects with an HTTP 301/302 response. PHP’s HTTP stream wrapper follows up to twenty redirects automatically, without re‑validating the destination host, giving an attacker the ability to fetch data from arbitrary internal or external addresses. If an attacker is able to supply or upload a spreadsheet containing such a formula, they can read up to 32,767 bytes of the response, enabling exfiltration of cloud service metadata, scanning of internal services, and access to back‑end endpoints. The vulnerability does not elevate the PHP process privileges; it simply offers network reachability and data exfiltration that can facilitate further attacks.

Affected Systems

The library affected is PhpSpreadsheet from PHPOffice. All releases up to and including 1.30.5, 2.0.0 through 2.1.17, 2.2.0 through 2.4.6, 3.3.0 through 3.10.6, and 4.0.0 through 5.8.0 are vulnerable. Fixed releases begin at 1.30.6, 2.1.18, 2.4.7, 3.10.7, and 5.8.1.

Risk and Exploitability

The CVSS score of 7.7 indicates a high impact with moderate exploitation complexity. The EPSS score is below 1 %, suggesting a low likelihood of exploitation at present. The vulnerability is not listed in CISA’s KEV catalog. An attacker who can provide a spreadsheet that triggers the WEBSERVICE function can reach arbitrary URLs, including internal services, and exfiltrate up to 32,767 bytes of response data. Exploitation requires only the ability to operate in an environment where the application processes untrusted spreadsheets.

Generated by OpenCVE AI on August 3, 2026 at 14:43 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to a fixed PhpSpreadsheet release (≥5.8.1, ≥3.10.7, ≥2.4.7, ≥2.1.18, or ≥1.30.6).
  • If upgrading immediately is not feasible, strictly validate the URL host in WEBSERVICE() and reject any request that results in a redirect to a non‑whitelisted host, or disable the WEBSERVICE function entirely for untrusted spreadsheets. This mitigates the SSRF path by enforcing host‑only validation and blocking redirect following.
  • Deploy additional monitoring or firewall rules to detect and block unexpected outbound requests originating from spreadsheet processing, and segregate internal services to limit potential data exfiltration.

Generated by OpenCVE AI on August 3, 2026 at 14:43 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-6hq5-7373-42rg PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist
History

Tue, 28 Jul 2026 20:00:00 +0000

Type Values Removed Values Added
First Time appeared Phpoffice
Phpoffice phpspreadsheet
Vendors & Products Phpoffice
Phpoffice phpspreadsheet

Tue, 28 Jul 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 28 Jul 2026 18:00:00 +0000

Type Values Removed Values Added
Description PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. In versions 4.0.0 through 5.8.0, 3.3.0 through 3.10.6, 2.2.0 through 2.4.6, 2.0.0 through 2.1.17, and all releases up to and including 1.30.5, the WEBSERVICE() domain whitelist can be bypassed via an HTTP redirect (SSRF). In Calculation/Web/Service.php, the webService() method validates a URL's host against the whitelist set via Spreadsheet::setDomainWhiteList(), then fetches content with file_get_contents($url, false, $ctx); because PHP's HTTP stream wrapper follows 301/302 redirects automatically (up to 20 hops) and the redirect target is never re-validated, an attacker who can trigger a redirect from a whitelisted domain can reach arbitrary URLs, including internal addresses. An attacker able to upload XLSX files to an application that uses setDomainWhiteList() and getCalculatedValue() can achieve a full-read SSRF, returning up to 32,767 bytes of the response body as a cell's calculated value, which enables exfiltration of cloud metadata (AWS/GCP/Azure credentials via http://169.254.169.254/), access to internal-only services, and internal port scanning (the port is not validated). This issue has been fixed in versions 5.8.1, 3.10.7, 2.4.7, 2.1.18, and 1.30.6.
Title PhpSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist
Weaknesses CWE-918
References
Metrics cvssV3_1

{'score': 7.7, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N'}


Subscriptions

Phpoffice Phpspreadsheet
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-28T18:13:17.566Z

Reserved: 2026-07-07T18:20:06.126Z

Link: CVE-2026-59931

cve-icon Vulnrichment

Updated: 2026-07-28T18:12:51.892Z

cve-icon NVD

Status : Deferred

Published: 2026-07-28T18:17:22.873

Modified: 2026-07-30T19:19:45.637

Link: CVE-2026-59931

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T14:45:04Z

Weaknesses
  • CWE-918

    Server-Side Request Forgery (SSRF)