---
id: "CVE-2026-108357"
kind: "vulnerability"
aliases: ["CVE-2026-108357"]
title: "PhpSpreadsheet: double-encoded XML bypasses DOCTYPE check, enabling file read"
severity: "high"
cvss: 8.8
epss: 0.00285
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["file-upload", "package", "php", "phpspreadsheet", "self-hosted"]
not_affected_if: ["patched-version", "static-input-only", "xml-reader-unused"]
published_at: "2026-10-22T18:17:26+00:00"
first_seen_at: "2026-10-23T21:57:31+00:00"
updated_at: "2026-10-24T07:15:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-108357", "first_seen_at": "2026-10-23T21:57:31+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-108357", "first_seen_at": "2026-10-24T07:15:51+00:00"}]
---

# PhpSpreadsheet: double-encoded XML bypasses DOCTYPE check, enabling file read

PhpSpreadsheet's SpreadsheetML XML reader decodes numeric entities after its DOCTYPE safety check, so a double-encoded less-than sign smuggles an unchecked entity declaration into the parser. An attacker who supplies a crafted XML spreadsheet can cause denial of service through entity expansion, and can read local files or make server-side requests on PHP before 8.0 or when LIBXML_NOENT is enabled.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

Run: composer show phpoffice/phpspreadsheet and check the installed version.
If the version is 3.3.0 to before 3.10.8, or 5.10.0 with the flaw present, you are exposed.
Check whether the app reads user-supplied SpreadsheetML (.xml) files with PhpSpreadsheet's Reader\Xml.

## Fix

Upgrade phpoffice/phpspreadsheet to 3.10.8 (3.x line) or 5.10.0 (5.x line).
Until upgraded, reject uploaded SpreadsheetML XML files or do not use the Xml reader on untrusted input.

## Timeline

- 2026-10-23T21:57:31+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-108357
- 2026-10-24T07:15:51+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-108357

## From the sources

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 entities only after each DOCTYPE pattern check. A double-encoded less-than character is reduced by the first callback to another encoded character and by the second callback to a literal less-than sign, so SimpleXML receives an unchecked DOCTYPE and entity declaration. Processing attacker-controlled SpreadsheetML XML can cause entity-expansion denial of service and can permit local file access or SSRF on PHP before 8.0 or when LIBXML_NOENT is enabled. This issue is fixed in versions 3.10.8 and 5.10.0.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
