Packagist
CVE-2026-108357
PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service
- Severity
- High
- Published
- 27 Oct 2026
- Last changed
- 27 Oct 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 3.10.8, 5.10.0
- Exploit chance
- 0.5% in the next 30 daysHigher than 40% of CVEs. EPSS by FIRST, 24 Nov 2026
- Also known as
- GHSA-rxj4-h86g-25gc
- Sources
- OSV.dev and GitHub
Description
The SpreadsheetML XML reader (Reader\Xml) scans file content twice through XmlScanner::scan(), and each scan runs an unentity() callback that calls html_entity_decode() after the pattern check. By double-encoding the < character as &#60;, the first scan decodes & to & (forming <), and the second scan decodes < to < (forming <!DOCTYPE). Neither scan's pattern check detects the <!DOCTYPE string because the callback runs after each check. This enables Denial of Service via entity expansion on all PHP versions, and XXE/SSRF on PHP < 8.0 or when LIBXML_NOENT is used.
The vulnerability involves an interaction between three code locations:
1. XmlScanner::scan() (XmlScanner.php, lines 87–108) — checks the pattern before the callback:
2. Xml::canRead() (Xml.php, lines 79–117) — scans and stores the result:
3. Xml::trySimpleXMLLoadStringPrivate() (Xml.php, lines 120–150) — re-scans the stored content:
The double-scan decode chain:
Affected software
| Software | Affected versions |
|---|---|
phpoffice/phpspreadsheetPackagist · osv:Packagist:phpoffice/phpspreadsheet |
|
About phpoffice/phpspreadsheet
- Monthly downloads (Packagist)
- 16,687,478Packagist, 23 Nov 2026
- Total downloads (Packagist)
- 377,146,696Packagist, 23 Nov 2026
Vulnerabilities in phpoffice/phpspreadsheet
- In our list
- 13
- Published in the last 12 months
- 12
- Critical, last 12 months
- 1
- High, last 12 months
- 8
- Known exploited
- 0
- CVE-2026-108360PhpSpreadsheet: SSRF whitelist bypass via unre-validated HTTP redirect in Drawing::setPath external image loadingMedium 6.4 27 Oct 2026
- CVE-2026-108359PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS)High 27 Oct 2026
- CVE-2026-108358PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of ServiceHigh 27 Oct 2026
- CVE-2026-59933PHPSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustionHigh 7.5 23 Jul 2026
- CVE-2026-59932PHPSpreadsheet: Gnumeric reader unbounded gzip expansion causes memory exhaustionHigh 7.5 23 Jul 2026
- CVE-2026-59931PHPSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelistHigh 7.7 23 Jul 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-108357
- GitHub Advisory Database https://github.com/advisories/GHSA-rxj4-h86g-25gc