PHPOffice PhpSpreadsheet
PhpSpreadsheet: File::prohibitWrappers bypass
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 1.30.5
Fixed in 1.30.5
Mitigation
Upgrade PhpSpreadsheet to 1.30.5 or later.
References
- Vendor advisory github.com/PHPOffice/PhpSpreadsheet/security/a…
Timeline
Days relative to CVE publicationFirst public PoC 12 days before publication; not in CISA KEV. First PoC: SangSenimanWartefak/CVE-2026-45034 (created 11 Jun 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| SangSenimanWartefak/CVE-2026-45034 | 11 Jun 2026 −12 d | 0 | PoC |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
PoC characteristics
What to hunt for in your logs · from 1 PoC repoPOST /vendor/phpoffice/phpspreadsheet/samples/index.php
- Body markers
------WebKitFormBoundary Content-Disposition: form-data; name="file"; filename="inmultipart/form-data; boundary=----WebKitFormBoundary- Seen in
- 1 repo: SangSenimanWartefak/CVE-2026-45034
- Evidence
- SangSenimanWartefak/CVE-2026-45034/CVE-2026-45034.yaml:21
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/vendor/phpoffice/phpspreadsheet/samples/index\.php(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET any (msg:"GG PoC-Monitor CVE-2026-45034 PHPOffice PhpSpreadsheet exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/vendor/phpoffice/phpspreadsheet/samples/index.php"; http.request_body; content:"------WebKitFormBoundary Content-Disposition: form-data|3b| name=|22|file|22||3b| filename=|22|"; reference:url,poc.griffinguard.io/cve/CVE-2026-45034; classtype:web-application-attack; sid:9377703; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: PHPOffice PhpSpreadsheet exploit attempt (CVE-2026-45034)
id: gg-pocmon-cve-2026-45034-9377703
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-45034. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-45034
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/vendor/phpoffice/phpspreadsheet/samples/index.php'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2026.45034