CVE-2026-59931

CVE-2026-59931 is a high-severity server-side request forgery (SSRF) vulnerability in phpoffice/phpspreadsheet (composer), affecting versions >= 4.0.0, <= 5.8.0. It is fixed in 5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

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

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

Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside. Typical impact: access to internal metadata services, internal APIs, or cloud credentials.

CVE-2026-59931 has a CVSS score of 7.7 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6); upgrading removes the vulnerable code path.

Affected versions

phpoffice/phpspreadsheet (>= 4.0.0, <= 5.8.0) phpoffice/phpspreadsheet (>= 3.3.0, <= 3.10.6) phpoffice/phpspreadsheet (>= 2.2.0, <= 2.4.6) phpoffice/phpspreadsheet (>= 2.0.0, <= 2.1.17) phpoffice/phpspreadsheet (<= 1.30.5)

Security releases

phpoffice/phpspreadsheet → 5.8.1 (composer) phpoffice/phpspreadsheet → 3.10.7 (composer) phpoffice/phpspreadsheet → 2.4.7 (composer) phpoffice/phpspreadsheet → 2.1.18 (composer) phpoffice/phpspreadsheet → 1.30.6 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

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.

Frequently Asked Questions

  1. What is CVE-2026-59931? CVE-2026-59931 is a high-severity server-side request forgery (SSRF) vulnerability in phpoffice/phpspreadsheet (composer), affecting versions >= 4.0.0, <= 5.8.0. It is fixed in 5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6. Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside.
  2. How severe is CVE-2026-59931? CVE-2026-59931 has a CVSS score of 7.7 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of phpoffice/phpspreadsheet are affected by CVE-2026-59931? phpoffice/phpspreadsheet (composer) versions >= 4.0.0, <= 5.8.0 is affected.
  4. Is there a fix for CVE-2026-59931? Yes. CVE-2026-59931 is fixed in 5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6. Upgrade to this version or later.
  5. Is CVE-2026-59931 exploitable, and should I be worried? Whether CVE-2026-59931 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-59931 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-59931?
    • Upgrade phpoffice/phpspreadsheet to 5.8.1 or later
    • Upgrade phpoffice/phpspreadsheet to 3.10.7 or later
    • Upgrade phpoffice/phpspreadsheet to 2.4.7 or later
    • Upgrade phpoffice/phpspreadsheet to 2.1.18 or later
    • Upgrade phpoffice/phpspreadsheet to 1.30.6 or later

Other vulnerabilities in phpoffice/phpspreadsheet

Stop the waste.
Protect your environment with Kodem.