Skip to main content

PhpSpreadsheet CVE-2026-45034

| EUVDEUVD-2026-38359 CRITICAL
Deserialization of Untrusted Data (CWE-502)
2026-06-08 https://github.com/PHPOffice/PhpSpreadsheet GHSA-87m4-826x-3crx
9.2
CVSS 4.0 · Vendor: https://github.com/PHPOffice/PhpSpreadsheet
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify endpoint passing filename to IOFactory::load
  2. Delivery
    Upload or stage malicious exploit.phar
  3. Exploit
    Submit path phar:///abs/exploit.phar/dummy.csv
  4. Install
    Bypass prohibitWrappers via parse_url false return
  5. C2
    PHP stream layer opens phar wrapper
  6. Execute
    Automatic metadata deserialization fires __wakeup/__destruct gadget
  7. Impact
    Execute arbitrary code as web user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Application must pass an attacker-influenced filename into PhpSpreadsheet's IOFactory::load() or another reader that routes through File::prohibitWrappers; attacker must be able to place a malicious phar file at a path readable by the PHP process (uploaded via the app, on a shared mount, or any writable location). The path must use the three-or-more-slash form phar:///... to bypass parse_url-based scheme detection. Direct unauthenticated RCE requires PHP 7.x (still automatically deserializes phar metadata on file-stat operations); on PHP 8.x the same bypass yields only a phar file-read primitive and RCE re-emerges only if downstream code invokes Phar::getMetadata on the path, which is not present in PhpSpreadsheet itself. A usable PHP gadget chain (loaded classes with exploitable __wakeup/__destruct) must exist in the victim process - PhpSpreadsheet plus typical framework dependencies generally provide such chains.

Impact

Signals diverge: the vendor-supplied CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H, score 9.2) and confirmed working PoC with full RCE on PHP 7.4 argue for a real and serious risk, while EPSS at 0.04% (12th percentile) and the absence of CISA KEV listing indicate no observed mass exploitation yet. The AT:P (Attack Requirements: Present) flag matches reality - exploitation requires (a) the application to pass attacker-influenced path strings into IOFactory::load or another PhpSpreadsheet loader, and (b) PHP 7.x for direct RCE (PHP 8.x branches only get a file-read primitive unless Phar::getMetadata is later called). PHP 7.x is end-of-life since November 2022, so the highest-impact case applies mostly to legacy or unmaintained deployments; modern PHP 8.x stacks are at materially lower risk but should still patch because the bypass plus a Phar::getMetadata sink in user code re-enables RCE. Net: a real priority for any application accepting user-supplied paths into PhpSpreadsheet, especially those still on PHP 7.x or pinned to 1.30.x.

Exploit ScenarioDerived

A web application uses PhpSpreadsheet to import spreadsheets and passes a user-controlled filename (e.g., from an uploaded file path, a URL parameter, or a stored reference) into IOFactory::load(). An attacker first uploads or otherwise places a crafted exploit.phar with a serialized gadget chain in its metadata, then triggers the loader with the path phar:///abs/path/to/exploit.phar/dummy.csv; on PHP 7.x this auto-deserializes the metadata via __wakeup/__destruct and yields full RCE as the web user, as demonstrated by the published Dockerized PoC (build-phar.php, exploit.php, run.sh) which writes a pwned_marker file.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv3 – Jun 22, 2026

Phar deserialization in PhpSpreadsheet (PHPOffice) is reachable on PHP 7.x because the File::prohibitWrappers helper added to patch CVE-2026-34084 can be bypassed with a three-slash phar URI such as phar:///path/file.phar/inner, where parse_url returns false and the wrapper check is skipped. Remote attackers who can supply a file path to IOFactory::load() achieve full RCE on PHP 7.x branches (1.x up to 1.30.4) and a phar file-read primitive on PHP 8.x branches up to 5.7.0; publicly available exploit code exists with a working Docker reproducer, though EPSS is only 0.04% (12th percentile).

Earlier versions of this analysis (2)
v2 Jun 22, 2026 - 21:45 cvss changed CVSS 9.2

Phar deserialization in PhpOffice PhpSpreadsheet (1.x through 5.7.x) bypasses the CVE-2026-34084 patch by exploiting a parse_url quirk: paths shaped like phar:///work/exploit.phar/dummy.csv cause prohibitWrappers() to return without throwing, letting IOFactory::load() reach the phar stream wrapper. On PHP 7.x this yields full unauthenticated RCE via automatic phar metadata deserialization invoking attacker-controlled __wakeup/__destruct; on PHP 8.x the primitive degrades to phar file read unless a downstream caller invokes Phar::getMetadata. Publicly available exploit code exists (Docker-based reproducer with negative and positive controls), though EPSS sits at 0.04% (12th percentile) and the issue is not on CISA KEV.

v1 Jun 08, 2026 - 23:15

Insecure deserialization in PhpOffice PhpSpreadsheet 1.30.4 and earlier allows remote code execution when an attacker-controlled file path with three or more slashes after the scheme (e.g. phar:///path/file.phar/inner) is passed to IOFactory::load, bypassing the prohibitWrappers helper introduced as a patch for CVE-2026-34084. On PHP 7.x this yields full RCE via automatic phar metadata deserialization invoking __wakeup/__destruct on attacker-controlled gadgets; on PHP 8.x branches (2.1.x through 5.7.x) the bypass exists but is reduced to a file-read primitive unless downstream code invokes Phar::getMetadata. Publicly available exploit code exists (Docker-based reproducer with negative and positive controls); no public exploit identified at time of analysis as actively used, and the CVE is not present in CISA KEV.

RemediationAI

Vendor-released patch: upgrade phpoffice/phpspreadsheet to 1.30.5 or later on the 1.x branch (per advisory GHSA-87m4-826x-3crx); fixes for branches 2.1.x, 2.4.x, 3.10.x, 5.6.x, and 5.7.0 are noted as forthcoming in the GitHub advisory and should be tracked at https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-87m4-826x-3crx. If immediate upgrade is not possible, apply the vendor-suggested code-level mitigation by replacing the parse_url-based check in File::prohibitWrappers with a str_contains($filename, '://') test or by normalizing the path through realpath() (which returns false for any wrapper prefix) - note that realpath will also reject legitimate non-existent relative paths, so test against existing call sites. Additional compensating controls: strictly validate or canonicalize any user-supplied path before passing it to IOFactory::load()/Reader::load(), reject inputs containing ://, and migrate off PHP 7.x to remove the automatic phar-metadata-deserialization sink (this eliminates direct RCE even if the bypass remains reachable, at the cost of an EOL PHP upgrade).

Affected VersionsENISA

PhpSpreadsheet < 1.30.5

Affected Packages

composer phpoffice/phpspreadsheet fix: 1.30.5
euvd phpspreadsheet fix: 1.30.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PhpSpreadsheet is a widely used pure-PHP library (Composer package phpoffice/phpspreadsheet, CPE pkg:composer/phpoffice_phpspreadsheet) for reading and writing spreadsheet formats. The root cause is CWE-502 (Deserialization of Untrusted Data) compounded by an incorrect input validation primitive: the patch for CVE-2026-34084 relied on parse_url($filename, PHP_URL_SCHEME) to detect stream wrappers, but parse_url returns boolean false for malformed URIs like phar:///path/file.phar/inner (three slashes after the scheme), so is_string($scheme) is false and the throw is skipped. PHP's stream layer still treats the same path as a valid phar wrapper. On PHP 7.x, automatic phar metadata deserialization on file-stat operations such as is_file triggers __wakeup/__destruct of attacker-controlled gadget objects; PHP 8.x removed that auto-deserialization, so the same bypass yields only a phar file-read unless a downstream caller invokes Phar::getMetadata directly.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/PHPOffice/PhpSpreadsheet) PRIMARY 9.2 CRITICAL
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
vuln.today AI 8.1 HIGH

Network-reachable via app loader, AC:H because RCE needs PHP 7.x plus a usable gadget chain and attacker-staged phar; PR:N/UI:N once a vulnerable upload/load path exists.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/PHPOffice/PhpSpreadsheet).

CVSS VectorVendor: https://github.com/PHPOffice/PhpSpreadsheet

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
Analysis Updated
Jun 22, 2026 - 21:46 vuln.today
v3 - CVSS changed
Analysis Updated
Jun 22, 2026 - 21:45 vuln.today
v2 - CVSS changed
CVSS changed
Jun 22, 2026 - 21:39 NVD
9.2 (CRITICAL)

DescriptionCVE.org

Summary

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.

Vulnerable code

The file vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php is byte identical across all six latest tags listed below:

php
public static function prohibitWrappers(string $filename): void
{
    $scheme = parse_url($filename, PHP_URL_SCHEME);
    if (is_string($scheme) && strlen($scheme) > 1) {
        throw new Exception("Stream wrappers are not permitted as file paths: {$filename}");
    }
}

For input phar://x/dummy.csv the call returns the string "phar" and the throw fires correctly. For input phar:///work/exploit.phar/dummy.csv the same call returns false and the throw is skipped, which is the bypass.

Confirmed affected versions

Tested on 2026-05-03. The prohibitWrappers source on disk is identical across all six tags.

BranchLatest tagPHP under testResult
1.x1.30.47.4bypass plus full RCE, gadget wrote marker file
2.1.x2.1.168.3bypass
2.4.x2.4.58.3bypass
3.10.x3.10.58.3bypass
5.6.x5.6.08.3bypass
5.7.x5.7.08.3bypass

Version 1.30.4 is the latest tag of the 1.x branch, which is the only branch that still supports PHP 7.x. Version 5.7.0 is the latest tag overall on Packagist at the time of testing.

No branch beyond 1.30.x allows any release before Php 8. For branches beyond 1.30.x, although the code identified above is in error, and will be corrected, it does not lead to any security exposure. That would require a Phar::getMetadata call, which is not present in PhpSpreadsheet. If possible and reasonable, the release notes for the fix on the other branches will include release-note: security.

Reproduction

Requires Docker only, no local PHP install. Run:

sh
bash run.sh

The script does the following in order: build exploit.phar using php:7.4-cli with phar.readonly=0, install phpoffice/phpspreadsheet:5.7.0 through composer and run exploit.php on php:8.3-cli to show that the bypass still works against the latest tag, then install 1.30.4 and run again on php:7.4-cli to show the full RCE chain. All output is teed to evidence.txt.

exploit.php ships two controls. The negative control uses phar://x/dummy.csv to confirm that the patch still rejects the standard wrapper form. The positive control uses phar:///work/exploit.phar/dummy.csv to show that the three slash variant slips through. On PHP 7.4 the gadget writes the file pwned_marker containing the lines WAKEUP: phpspreadsheet-bypass and DESTRUCT: phpspreadsheet-bypass, which is the proof that attacker controlled code ran inside the victim process.

Suggested fix

Do not rely on parse_url to detect wrappers, because its behavior depends on the slash count and on the PHP version. Either of these is safe:

php
public static function prohibitWrappers(string $filename): void
{
    if (str_contains($filename, '://')) {
        throw new Exception("Stream wrappers are not permitted as file paths: {$filename}");
    }
}

Alternatively, run the path through realpath() first, since realpath returns false for any wrapper prefixed path.

Files in this report

  • build-phar.php: builds exploit.phar with a gadget object in its metadata.
  • exploit.php: main PoC, with the negative and positive controls.
  • exploit.phar: prebuilt phar, the gadget writes a marker when deserialized.
  • composer.json: spec used by composer to install the version under test.
  • run.sh: end to end reproducer through Docker.
  • evidence.txt: log captured from the most recent run.sh invocation.

Executive ViewAI

Why It Matters

PhpSpreadsheet (PHPOffice) versions 1.x through 1.30.4 and 5.x through 5.7.0 contain a critical deserialization flaw enabling remote code execution on PHP 7.x systems and file disclosure on PHP 8.x. Organizations accepting untrusted spreadsheet files through IOFactory::load() face immediate RCE risk, with publicly available exploit code already circulating.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Prevalence
High
widely used PHP spreadsheet library, common in web apps and CMS plugins
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy