BuzzPHP
LightDarkSystem

PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist

High severity. Published 23 July 2026. Update phpoffice/phpspreadsheet to the fixed version of your branch (5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6): composer update phpoffice/phpspreadsheet.

Which versions are affected?

PackageAffected versionsFixed in
phpoffice/phpspreadsheet (opens in a new tab)>= 4.0.0, <= 5.8.0 | >= 3.3.0, <= 3.10.6 | >= 2.2.0, <= 2.4.6 | >= 2.0.0, <= 2.1.17 | <= 1.30.55.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6

What should you do?

Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:

composer show phpoffice/phpspreadsheet
composer audit

Advisory details

SeverityHighCVSS 7.7
Published
Updated
CVECVE-2026-59931 (opens in a new tab)
GHSAGHSA-6hq5-7373-42rg (opens in a new tab)
WeaknessCWE-918

What the advisory says

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 filegetcontents() 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 filegetcontents($url, false, $ctx) to fetch the content.

Source: GHSA-6hq5-7373-42rg (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .

Other recent advisories for this package

All Composer security advisories