CVE-2026-45034: PHPSpreadsheet Patch Bypass Leading to Remote Code Execution
Summary
CVE-2026-45034: PHPSpreadsheet has a patch bypass for CVE-2026-34084. Affects phpoffice/phpspreadsheet versions < 1.30.5. Fixed in 1.30.5. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PHPSpreadsheet is a widely used library for reading and writing spreadsheet files in PHP. It provides a range of features for handling various spreadsheet formats, making it a popular choice among developers. However, it has been found to have a critical vulnerability that allows attackers to bypass security measures and potentially execute arbitrary code.
Vulnerability Detail
The vulnerability arises from a flaw in the prohibitWrappers helper function, which is intended to prevent the use of stream wrappers like phar://. The function incorrectly relies on parse_url, which can return false for certain inputs, allowing attackers to exploit this bypass. When an attacker uses a specially crafted input, they can trigger the PHP stream layer to treat it as a valid phar wrapper, leading to remote code execution (RCE) on PHP 7.x systems. On PHP 8.x, while the immediate RCE is mitigated, the potential for exploitation remains if downstream consumers invoke certain methods.
How To Fix
Minimum fixed version
1.30.5
This is the first release that contains the fix.
composer require phpoffice/phpspreadsheet:1.30.5
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can modify the prohibitWrappers function to check for stream wrappers without relying on parse_url. Here is an example of how to implement this:
public static function prohibitWrappers(string $filename): void {
if (str_contains($filename, ':\/\/')) {
throw new Exception("Stream wrappers are not permitted as file paths: {$filename}");
}
}
Conclusion
In summary, CVE-2026-45034 is a critical vulnerability in PHPSpreadsheet that can lead to remote code execution if not addressed. Users are strongly advised to update to the latest version or implement the provided workaround to mitigate the risk.
See every vulnerability recorded for phpoffice/phpspreadsheet →
FAQ
CVE-2026-45034 is a vulnerability in PHPSpreadsheet that allows attackers to bypass security measures and potentially execute arbitrary code.
You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to use the Vulert playground without signup.
Versions 1.30.4 and earlier are affected by this vulnerability. The latest patched version is 1.30.5.
If you cannot update immediately, implement the suggested workaround to modify the prohibitWrappers function to prevent the use of stream wrappers.
The CVSS score of this vulnerability is 9.2, indicating a critical level of severity.
References
Related vulnerabilities
Recent vulnerabilities recorded for phpoffice/phpspreadsheet.