All vulnerabilities

Packagist

CVE-2026-108358

PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences 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
1.30.7, 2.1.19, 2.4.8, 3.10.8, 5.10.0
Exploit chance
0.6% in the next 30 daysHigher than 50% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
XML external entities (XXE) (CWE-611)XML entity expansion (CWE-776)
Also known as
GHSA-3x94-m842-937c
Sources
OSV.dev and GitHub

Description

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 LIBXML_NOENT is used. Any application using PhpSpreadsheet to process user-uploaded XLSX files is affected.

The vulnerability exists in src/PhpSpreadsheet/Reader/Security/XmlScanner.php, method scan(), lines 87–100.

The scanner builds a regex pattern /\0*<\0*!\0*D\0*O\0*C\0*T\0*Y\0*P\0*E\0*/ that only handles NULL byte interleaving. ISO-2022 escape sequences (e.g., 0x1B 0x28 0x42 for ISO-2022-JP) inserted between each character of <!DOCTYPE break the regex because it only expects optional \0 between characters.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
phpoffice/phpspreadsheetPackagist · osv:Packagist:phpoffice/phpspreadsheet
  • Every version before 1.30.7
  • From 2.0.0 before 2.1.19
  • From 2.2.0 before 2.4.8
  • From 3.3.0 before 3.10.8
  • From 4.0.0 before 5.10.0

About phpoffice/phpspreadsheet

Monthly downloads (Packagist)
16,687,478Packagist, 23 Nov 2026
Total downloads (Packagist)
377,146,696Packagist, 23 Nov 2026

References