Skip to content
Laskyr

phpoffice/phpspreadsheet security advisory

CVE-2026-45034: PHPSpreadsheet has a patch bypass for CVE-2026-34084

CVE-2026-45034 is a critical-severity PHP object injection vulnerability in the PHP package phpoffice/phpspreadsheet (CVSS 9.2), published 22 June 2026. The advisory does not name a fixed version. It can be exploited without an account.

critical 9.2 published 2026-06-22 · updated 2026-10-25

The advisory does not name a fixed version

This PHP object injection issue affects phpoffice/phpspreadsheet versions <= 1.30.4. The newest release (5.10.0) is outside the affected range.

Affected versions
<= 1.30.4
Fixed in
not stated
Newest release
5.10.0
Severity
Critical · CVSS 9.2
Type
PHP object injection
CWE-502
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-04

Is your phpoffice/phpspreadsheet version affected?

Run composer show phpoffice/phpspreadsheet in your project, then enter the version. We check it against this and every other known phpoffice/phpspreadsheet advisory.

Who can exploit CVE-2026-45034

CVSS vector (scored by GitHub): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Your app is only exposed if it uses the affected part of phpoffice/phpspreadsheet. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-45034 in phpoffice/phpspreadsheet

  1. Find the installed version: composer show phpoffice/phpspreadsheet. If you never required it yourself, composer why phpoffice/phpspreadsheet shows which package pulls it in.
  2. Update it: composer update phpoffice/phpspreadsheet --with-all-dependencies.
  3. 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.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-45034.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for PHP object injection issues while the upgrade waits. None of it replaces the fix.

The CVE-2026-45034 advisory

PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. Prior to 1.30.5, CVE-2026-34084 was patched by the helper File::prohibitWrappers. The helper calls parse_url($filename, PHP_URL_SCHEME) and then checks is_string($scheme) && strlen($scheme) > 1 to reject stream wrappers such as phar://, php://, data:// or expect://. The check is not equivalent to "does the path contain a wrapper". When the input has the form phar:///path/file.phar/inner with three or more slashes after the scheme, parse_url returns boolean false instead of returning the scheme string. The is_string($scheme) branch is therefore skipped, the helper returns without throwing, and the caller proceeds. PHP's stream layer, however, still treats phar:///... as a valid phar wrapper and opens the underlying phar file. The result is that IOFactory::load($attackerPath) walks past the patch and still touches the phar wrapper. On PHP 7.x, simply reaching the phar wrapper via is_file is enough for PHP to automatically deserialize the phar metadata, which in turn invokes the magic methods __wakeup and __destruct of an attacker controlled object and gives full RCE. On PHP 8.x, automatic metadata deserialization for plain file ops was removed, so the chain at the PhpSpreadsheet layer reduces to a phar wrapper file read primitive, and RCE only resurfaces if the downstream consumer ever calls Phar::getMetadata. This vulnerability is fixed in 1.30.5.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-45034. Advisory title: “PHPSpreadsheet has a patch bypass for CVE-2026-34084”.

References

Other phpoffice/phpspreadsheet advisories

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 fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit