Executive brief
PhpSpreadsheet is a widely used PHP library for reading and writing spreadsheet files, often integrated into web applications for data imports. A security flaw allows attackers to provide malicious file paths that trick the server into performing unintended actions. This can lead to the theft of internal data or, in some cases, allow an attacker to take full control of the server by executing malicious code.
Technical details
A vulnerability exists in the IOFactory::load() method of PhpSpreadsheet due to insufficient validation of the filename argument. The library uses File::assertFile(), which relies on the PHP is_file() function; this function is aware of PHP stream wrappers. An attacker can provide paths using wrappers such as phar://, ftp://, or ssh2.sftp://. The phar:// wrapper triggers deserialization of PHAR metadata, which can lead to Remote Code Execution (RCE) if a suitable POP gadget chain exists in the application environment. Additionally, ftp:// and ssh2.sftp:// wrappers can be used to perform Server-Side Request Forgery (SSRF). The issue is fixed in versions 1.30.3, 2.1.15, 2.4.4, 3.10.4, and 5.6.0.
Affected products
- PHPOffice PhpSpreadsheet <= 1.30.2, 2.0.0 - 2.1.14, 2.2.0 - 2.4.3, 3.3.0 - 3.10.3, 4.0.0 - 5.5.0
Timeline
- 2026-04-28: advisory: Original GitHub security advisory published
- 2026-05-05: disclosed: CVE-2026-34084 published to NVD