phpoffice/phpspreadsheet security advisory
CVE-2026-59931: PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist
CVE-2026-59931 is a high-severity SSRF vulnerability in the PHP package phpoffice/phpspreadsheet (CVSS 7.7), published 28 July 2026. The advisory does not name a fixed version. Exploiting it needs a low-privilege user account.
high 7.7 published 2026-07-28 · updated 2026-10-23
- Affected versions
- <= 1.30.5
>= 2.0.0, <= 2.1.17
>= 2.2.0, <= 2.4.6
>= 3.3.0, <= 3.10.6
>= 4.0.0, <= 5.8.0 - Fixed in
- not stated
- Newest release
- 5.10.0
- Severity
- High · CVSS 7.7
- Type
- Server-side request forgery (SSRF)
CWE-918 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your phpoffice/phpspreadsheet version affected?
Who can exploit CVE-2026-59931
- Access: A normal, low-privilege user account in the app.
CVSS vector (scored by GitHub): CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
How to fix CVE-2026-59931 in phpoffice/phpspreadsheet
- Find the installed version:
composer show phpoffice/phpspreadsheet. If you never required it yourself,composer why phpoffice/phpspreadsheetshows which package pulls it in. - Update it:
composer update phpoffice/phpspreadsheet --with-all-dependencies. - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"phpoffice/phpspreadsheet": "^5.10.0"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-59931. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Block outbound requests from the app server to private ranges and cloud metadata (169.254.169.254) at the firewall.
- Do not pass user-supplied URLs to the affected feature.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-59931 advisory
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.
References
- GitHub advisory GHSA-6hq5-7373-42rg github.com
- Fix commit 7ef7b25 github.com
- Release 1.30.6 github.com
- Release 2.1.18 github.com
- Release 2.4.7 github.com
- Release 3.10.7 github.com
- Release 5.8.1 github.com
Other phpoffice/phpspreadsheet advisories
- medium CVE-2026-108360: PhpSpreadsheet: SSRF whitelist bypass via unre-validated HTTP redirect in Drawing::setPath external image loading 2026-10-27
- high CVE-2026-108359: PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS) 2026-10-27
- high CVE-2026-108358: PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service 2026-10-27
- high CVE-2026-108357: PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service 2026-10-27
- high CVE-2026-59933: PHPSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustion 2026-07-23
- high CVE-2026-59932: PHPSpreadsheet: Gnumeric reader unbounded gzip expansion causes memory exhaustion 2026-07-23
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.