PHPSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustion
High severity. Published 23 July 2026. Update phpoffice/phpspreadsheet to the fixed version of your branch (5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6): composer update phpoffice/phpspreadsheet.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| phpoffice/phpspreadsheet (opens in a new tab) | >= 4.0.0, <= 5.8.0 | >= 3.3.0, <= 3.10.6 | >= 2.2.0, <= 2.4.6 | >= 2.0.0, <= 2.1.17 | <= 1.30.5 | 5.8.1, 3.10.7, 2.4.7, 2.1.18, 1.30.6 |
What should you do?
Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:
composer show phpoffice/phpspreadsheet
composer auditAdvisory details
| Severity | HighCVSS 7.5 |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-59933 (opens in a new tab) |
| GHSA | GHSA-xh5m-36r6-47m3 (opens in a new tab) |
| Weakness | CWE-400, CWE-835 |
What the advisory says
Summary
PhpSpreadsheet's OLE reader follows sector chains from attacker-controlled XLS/OLE metadata without detecting cycles or enforcing a maximum chain length. A tiny malformed .xls/OLE file can set the small-block depot sector chain to point back to itself. During normal XLS detection, OLERead::read() appends the same sector data repeatedly until the PHP process exhausts memory.
This is reachable from Reader\Xls::canRead() and therefore from automatic spreadsheet type detection. Applications that accept attacker-controlled spreadsheet uploads can suffer denial of service from a very small file.
Vulnerability details
Source: GHSA-xh5m-36r6-47m3 (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .
Other recent advisories for this package
- PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service (high, 27 October 2026)
- PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS) (high, 27 October 2026)
- PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service (high, 27 October 2026)
- PhpSpreadsheet: SSRF whitelist bypass via unre-validated HTTP redirect in Drawing::setPath external image loading (opens in a new tab) (medium, 27 October 2026)
- PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist (high, 23 July 2026)