Vulnerabilities

Vulnerability · CVE-2026-108357

PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service

Published Oct 22, 2026 · catalog updated Oct 27, 2026 · PHPOffice PhpSpreadsheet

Last checked Nov 5, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-108357. EPSS is 0.46%. Act only if a listed version of PHPOffice PhpSpreadsheet is installed.

Gaps on this record

  • No vendor fix or required action is stored. Compare the linked advisory before you change production.

Same product and reporting

Severity
High8.8
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.46%
Remediation
Version ranges on file
Affected products
Packagist phpoffice/phpspreadsheet · composer phpoffice · composer phpoffice/phpspreadsheet · vendor PHPOffice PhpSpreadsheet

### Summary The SpreadsheetML XML reader ( ) scans file content **twice** through , and each scan runs an callback that calls **after** the pattern check. By double-encoding the character as , the first scan decodes to (forming ), and the second scan decodes to (forming ). Neither scan's pattern check detects the 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 is used. ### Details The vulnerability involves an interaction between three code locations: **1. ** (XmlScanner.php, lines 87–108) — checks the pattern *before* the callback: **2. ** (Xml.php, lines 79–117) — scans and stores the result: **3. ** (Xml.php, lines 120–150) — re-scans the stored content: The double-scan decode chain: The callback (Xml.php, lines 54–61) protects five named entities ( ) via Unicode placeholders, but numeric entities ( ) are not protected and are decoded by . ### PoC Save the following as in a directory with PhpSpreadsheet installed via Composer: Run: **Expected result:** The file loads successfully, bypassing both scan passes. Internal entities expand, consuming ~45 MB of memory. Cell A1 contains 32,767 bytes (PhpSpreadsheet's max cell length, confirming entity expansion). **Hex variant:** Replace with — both are decoded by . **Tested on:** PhpSpreadsheet 5.9.0, PHP 8.5.3, libxml2 2.9.13. ### Impact | Attack | PHP < 8.0 / libxml2 < 2.9 | PHP 8.x / libxml2 2.9+ | |--------|---------------------------|------------------------| | Denial of Service (quadratic blowup) | **Exploitable** | **Exploitable** | | Local file read via SYSTEM entity | **Exploitable** | Blocked by default | | SSRF via SYSTEM entity | **Exploitable** | Blocked by default | | File read when LIBXML_NOENT is used | **Exploitable** | **Exploitable** | Any application that accepts user-uploaded SpreadsheetML XML files (recognized by the processing instruction) and processes them with PhpSpreadsheet's reader

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • Packagist phpoffice/phpspreadsheet3.3.0 → 3.10.8
  • Packagist phpoffice/phpspreadsheet4.0.0 → 5.10.0
  • composer phpofficeversion unspecified
  • composer phpoffice/phpspreadsheet>= 3.3.0, <= 3.10.7
  • composer phpoffice/phpspreadsheet>= 4.0.0, <= 5.9.0
  • vendor PHPOffice PhpSpreadsheetversion unspecified

How to fix CVE-2026-108357

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-108357. EPSS is 0.46%. Act only if a listed version of PHPOffice PhpSpreadsheet is installed.

Which versions are affected?

Compare what you have installed with 3.3.0 → 3.10.8, 4.0.0 → 5.10.0, >= 3.3.0, <= 3.10.7, >= 4.0.0, <= 5.9.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-611: XML External Entity (XXE); CWE-776. EPSS 0.46%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 27, 2026 · GitHub Advisory Database

    Detected

    ### Summary The SpreadsheetML XML reader ( ) scans file content **twice** through , and each scan runs an callback that calls **after** the pattern check. By double-encoding the character as , the first scan decodes to (forming ), and the second scan decodes to (forming ). Neither scan's pattern check detects the string because the callback runs after each check. This enables Denial of Service via

  2. Oct 27, 2026 · GitHub Advisory Database

    Updated

    ### Summary The SpreadsheetML XML reader ( ) scans file content **twice** through , and each scan runs an callback that calls **after** the pattern check. By double-encoding the character as , the first scan decodes to (forming ), and the second scan decodes to (forming ). Neither scan's pattern check detects the string because the callback runs after each check. This enables Denial of Service via

  3. Oct 27, 2026 · GitHub Advisory Database

    Fix available

    phpoffice/phpspreadsheet fixed in 5.10.0; phpoffice/phpspreadsheet fixed in 3.10.8

  4. Oct 27, 2026 · GitHub Advisory Database

    Fix available

    phpoffice/phpspreadsheet fixed in 5.10.0

  5. Oct 27, 2026 · GitHub Advisory Database

    Fix available

    phpoffice/phpspreadsheet fixed in 3.10.8

  6. Oct 27, 2026 · GitHub Advisory Database

    Updated

    ### Summary The SpreadsheetML XML reader ( ) scans file content **twice** through , and each scan runs an callback that calls **after** the pattern check. By double-encoding the character as , the first scan decodes to (forming ), and the second scan decodes to (forming ). Neither scan's pattern check detects the string because the callback runs after each check. This enables Denial of Service via

Sources

  • CVE.orgVulnerability recordCVE-2026-108357

    PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. From 3.3.0 until 3.10.8 and 5.10.0, Reader\Xml passes stored SpreadsheetML XML through XmlScanner::scan in Xml::canRead and Xml::trySimpleXMLLoadStringPrivate, while Xml::unentity decodes numeric enti

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-108357

    30-day exploitation probability 0.46%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-rxj4-h86g-25gc

    PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service

    github.com
  • GitLab Advisory DatabasePackage advisoryCVE-2026-108357

    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 &#38;#60;, the first scan decodes &#38; to & (forming &#60;), and the second scan decodes &#60; to < (forming <!DOCTYPE). Neither scan's pattern check detects the <!DOC

    advisories.gitlab.com
  • OpenSSF OSV / OSV ScannerPackage advisoryGHSA-rxj4-h86g-25gc

    PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service

    osv.dev

References

Freshness

Last verified in this catalog Nov 5, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSNov 5, 2026
  • GitLab Advisory DatabaseOct 28, 2026
  • GitHub Advisory DatabaseOct 28, 2026
  • OpenSSF OSV / OSV ScannerOct 28, 2026
  • CVE.orgOct 27, 2026