Packagist
CVE-2026-59931
PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist
- Severity
- High 7.7
- Published
- 23 Jul 2026
- Last changed
- 23 Jul 2026
- Added to UpHeron
- 22 Oct 2026
- Fixed in
- 1.30.6, 2.1.18, 2.4.7, 3.10.7, 5.8.1
- Exploit chance
- 0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 19 Nov 2026
- Attack
- Over the network · Needs a user account · No user action needed
- Attacker can
- Read data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N- Also known as
- GHSA-6hq5-7373-42rg
- Sources
- OSV.dev and GitHub
Description
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.
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:
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.
Affected software
| Software | Affected versions |
|---|---|
phpoffice/phpspreadsheetPackagist · osv:Packagist:phpoffice/phpspreadsheet |
|
About phpoffice/phpspreadsheet
- Monthly downloads (Packagist)
- 15,804,115Packagist, 16 Nov 2026
- Total downloads (Packagist)
- 372,631,237Packagist, 16 Nov 2026
Vulnerabilities in phpoffice/phpspreadsheet
- In our list
- 9
- Published in the last 12 months
- 8
- Critical, last 12 months
- 1
- High, last 12 months
- 5
- Known exploited
- 0
- CVE-2026-59933PHPSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustionHigh 7.5 23 Jul 2026
- CVE-2026-59932PHPSpreadsheet: Gnumeric reader unbounded gzip expansion causes memory exhaustionHigh 7.5 23 Jul 2026
- CVE-2026-40902PhpSpreadsheet has CPU Denial of Service via Unbounded Row Number in XLSX Row DimensionsHigh 7.5 29 Apr 2026
- CVE-2026-40863PhpSpreadsheet has CPU Denial of Service via Unbounded Row Index in SpreadsheetML XML ReaderHigh 7.5 29 Apr 2026
- CVE-2026-34084PhpSpreadsheet has SSRF/RCE in IOFactory::load when $filename is user controlledCritical 29 Apr 2026
- CVE-2026-40296PhpSpreadsheet has XSS via number format code with @ text placeholder bypasses htmlspecialchars in HTML writerMedium 5.4 28 Apr 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-59931
- GitHub Advisory Database https://github.com/advisories/GHSA-6hq5-7373-42rg