# PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service

High severity, published 2026-10-27. 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.

Canonical URL: https://buzzphp.com/security/ghsa-3x94-m842-937c · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high |
| Published | 2026-10-27 |
| Updated | 2026-10-27 |
| CVE | [CVE-2026-108358](https://nvd.nist.gov/vuln/detail/CVE-2026-108358) |
| GHSA | [GHSA-3x94-m842-937c](https://github.com/advisories/GHSA-3x94-m842-937c) |
| Weakness | CWE-611, CWE-776 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| phpoffice/phpspreadsheet | >= 4.0.0, <= 5.9.0 or >= 3.3.0, <= 3.10.7 or >= 2.2.0, <= 2.4.7 or >= 2.0.0, <= 2.1.18 or <= 1.30.6 | 5.10.0, 3.10.8, 2.4.8, 2.1.19, 1.30.7 |

## What to do

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.

Check which version you run with `composer show phpoffice/phpspreadsheet`, and every affected package with `composer audit`.

## About this advisory

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.



## Links

- [GHSA-3x94-m842-937c on GitHub](https://github.com/advisories/GHSA-3x94-m842-937c)
- [CVE-2026-108358 on the National Vulnerability Database](https://nvd.nist.gov/vuln/detail/CVE-2026-108358)
- [All Composer security advisories](https://buzzphp.com/security)
