CVE-2026-34084·PHP vulnerability
PhpSpreadsheet is a library for reading and writing spreadsheet files. In versions 1.30.2 and earlier, 2.0.0 through 2.1.14, 2.2.0 through 2.4.3, 3.3.0 through 3.10.3, and 4.0.0 through 5.5.0, when the filename argument to IOFactory::load() is user-controlled, an attacker can supply a PHP stream wrapper path (such as phar://, ftp://, or ssh2.sftp://) that passes the is_file() check in File::assertFile(). The phar:// wrapper triggers deserialization of the PHAR metadata, which can lead to remote code execution if a suitable gadget chain is available in the application. The ftp:// and ssh2.sftp:// wrappers can be used for server-side request forgery. This issue has been fixed in versions 1.30.3, 2.1.15, 2.4.4, 3.10.4, and 5.6.0.
- Severity
- critical
- Software
- PHP
- Fixed in
- 5.6.0
- Published
- 2026-05-05
Affected versions
From: 4.0.0
Until: 5.6.0
Fixed in: 5.6.0
How to fix this CVE
Update PHP and PhpSpreadsheet to patch a critical deserialization vulnerability that allows remote code execution through crafted stream wrapper paths in file loading functions. Applications using PhpSpreadsheet versions 4.0.0 through 5.5.0 must upgrade to version 5.6.0 or later immediately. Additionally, implement input validation to reject user-supplied filenames containing stream wrapper protocols (phar://, ftp://, ssh2.sftp://, etc.) before passing them to IOFactory::load().
sudo dnf update phpDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST|GET request containing IOFactory::load parameter with values matching (phar://|ftp://|ssh2\.sftp://) followed by file paths; or error messages indicating unserialization attempts from PHAR metadata; or exceptions from stream wrapper protocol handlers in PHP logsWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block HTTP requests containing stream wrapper protocol schemes (phar://, ftp://, ssh2.sftp://, etc.) in parameters commonly used for file upload or file path operations. Implement strict input validation rules that reject any filename parameter containing '://' unless explicitly whitelisted.How to check if you are affected
- Check the installed version of PhpSpreadsheet by running: grep -r 'VERSION\|version' /vendor/phpoffice/phpspreadsheet/composer.json or php -r "require 'vendor/autoload.php'; echo \\PhpOffice\\PhpSpreadsheet\\Spreadsheet::VERSION;"
- Identify all code locations calling IOFactory::load() with user-controlled input by running: grep -r "IOFactory::load" /app/src --include="*.php" | grep -E "\$_GET|\$_POST|\$_REQUEST|\$_FILES"
- Search application logs for attempts to load phar://, ftp://, or ssh2.sftp:// URLs by running: grep -E "(phar://|ftp://|ssh2\.sftp://)" /var/log/php-errors.log /var/log/apache2/error.log
- Verify the patch by checking the PhpSpreadsheet version is 5.6.0 or higher and confirm no stream wrapper protocols are accepted in file loading functions
FAQ
What is CVE-2026-34084?
This is a critical remote code execution vulnerability in PhpSpreadsheet library where an attacker can bypass file path validation and supply malicious PHP stream wrapper URLs (phar://, ftp://, ssh2.sftp://) to trigger unsafe deserialization and code execution. The vulnerability affects versions 4.0.0 through 5.5.0.
Is CVE-2026-34084 being actively exploited?
According to CISA, this vulnerability is not currently listed in the Known Exploited Vulnerabilities catalog, and no public exploits have been publicly disclosed, but the critical CVSS score of 9.8 warrants immediate patching.
What versions of PHP are affected by CVE-2026-34084?
The vulnerability affects PhpSpreadsheet library versions 4.0.0 through 5.5.0 (and legacy branches 1.30.2 and earlier, 2.0.0-2.1.14, 2.2.0-2.4.3, 3.3.0-3.10.3). Any PHP application using these versions is vulnerable regardless of PHP engine version.
How do I check if my server is vulnerable to CVE-2026-34084?
Run 'composer show phpoffice/phpspreadsheet' in your application directory to check the installed version. If it's between 4.0.0 and 5.5.0, your application is vulnerable. Also verify whether user input is directly passed to IOFactory::load() without validation.
Does Defensia detect CVE-2026-34084?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PhpSpreadsheet is present in your application dependencies, CVE-2026-34084 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-34084. Free for 1 server.
Get started free