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


- **Severity:** High 8.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:L/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 22 Oct 2026
- **Updated:** 23 Oct 2026
- **Also known as:** GHSA-rxj4-h86g-25gc

## What is CVE-2026-108357?

CVE-2026-108357 is a high-severity vulnerability in PHPOffice PhpSpreadsheet, published on 22 Oct 2026. 

### Official description

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.

Weakness: CWE-776 (Improper Restriction of Recursive Entity References in DTDs), CWE-611 (Improper Restriction of XML External Entity Reference)

## Which versions are affected by CVE-2026-108357?

4 open source packages ship an affected version, including phpoffice/phpspreadsheet.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `phpoffice/phpspreadsheet` | Packagist | From 3.3.0 | 3.10.8 |
| `phpoffice/phpspreadsheet` | Packagist | From 3.3.0 | 3.10.8 |
| `phpoffice/phpspreadsheet` | Packagist | From 4.0.0 | 5.10.0 |
| `phpoffice/phpspreadsheet` | Packagist | From 4.0.0 | 5.10.0 |

## How do I fix CVE-2026-108357?

Upgrade phpoffice/phpspreadsheet to a fixed version for your release line: 3.10.8 or 5.10.0.

## Is CVE-2026-108357 being exploited?

There is no known exploitation of CVE-2026-108357 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-108357 and fix it if it is affected.

What it is: CVE-2026-108357 is a high-severity vulnerability in PHPOffice PhpSpreadsheet, published on 22 Oct 2026. 
Exploitation: There is no known exploitation of CVE-2026-108357 in the wild and no public exploit code.

Affected packages and fixed versions:
- phpoffice/phpspreadsheet (Packagist): affected from 3.3.0; fixed in 3.10.8
- phpoffice/phpspreadsheet (Packagist): affected from 3.3.0; fixed in 3.10.8
- phpoffice/phpspreadsheet (Packagist): affected from 4.0.0; fixed in 5.10.0
- phpoffice/phpspreadsheet (Packagist): affected from 4.0.0; fixed in 5.10.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-108357/ (Markdown: https://insights.sbomify.com/CVE-2026-108357/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-108357
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-108357
- OSV: https://osv.dev/vulnerability/CVE-2026-108357

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-108357/
Summaries are generated and may contain mistakes; the official description above is the record.
