PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service
High severity. Published 27 October 2026. Update phpoffice/phpspreadsheet to the fixed version of your branch (5.10.0, 3.10.8, 2.4.8, 2.1.19, 1.30.7): composer update phpoffice/phpspreadsheet.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| phpoffice/phpspreadsheet (opens in a new tab) | >= 4.0.0, <= 5.9.0 | >= 3.3.0, <= 3.10.7 | >= 2.2.0, <= 2.4.7 | >= 2.0.0, <= 2.1.18 | <= 1.30.6 | 5.10.0, 3.10.8, 2.4.8, 2.1.19, 1.30.7 |
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 | High |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-108358 (opens in a new tab) |
| GHSA | GHSA-3x94-m842-937c (opens in a new tab) |
| Weakness | CWE-611, CWE-776 |
What the advisory says
Summary PhpSpreadsheet's XmlScanner::scan() uses a regex pattern that only accounts for NULL byte (0x00) interleaving when detecting <!DOCTYPE. ISO-2022 escape sequences (0x1B bytes) inserted between the characters of the pattern break the regex match entirely, allowing DOCTYPE declarations with entity definitions to pass through undetected. This enables Denial of Service via quadratic entity expansion on all PHP versions, and XXE/SSRF on PHP < 8.0 or when LIBXMLNOENT is used. Any application using PhpSpreadsheet to process user-uploaded XLSX files is affected.
Details The vulnerability exists in src/PhpSpreadsheet/Reader/Security/XmlScanner.php, method scan(), lines 87–100.
Source: GHSA-3x94-m842-937c (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: SSRF whitelist bypass via unre-validated HTTP redirect in Drawing::setPath external image loading (opens in a new tab) (medium, 27 October 2026)
- PHPSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustion (high, 23 July 2026)
- PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist (high, 23 July 2026)