# CVE-2026-108358: PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences 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:** CLSA-2026-1793283095, GHSA-3x94-m842-937c

## What is CVE-2026-108358?

CVE-2026-108358 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. Prior to 1.30.7, 2.1.19, 2.4.8, 3.10.8, and 5.10.0, XmlScanner::scan in src/PhpSpreadsheet/Reader/Security/XmlScanner.php uses a DOCTYPE detection pattern that accounts for NUL-byte interleaving but not ISO-2022 escape sequences in XLSX XML parts. The escape sequences prevent the scanner from matching the declaration, and XML charset normalization then removes the escape bytes before parsing, exposing a valid DOCTYPE and entity definitions. Processing an attacker-controlled XLSX can therefore cause entity-expansion denial of service on supported PHP versions 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 1.30.7, 2.1.19, 2.4.8, 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-108358?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `phpoffice/phpspreadsheet` | Packagist | All versions | 1.30.7 |
| `phpoffice/phpspreadsheet` | Packagist | All versions | 1.30.7 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.0.0 | 2.1.19 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.0.0 | 2.1.19 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.2.0 | 2.4.8 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.2.0 | 2.4.8 |
| `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-108358?

Upgrade phpoffice/phpspreadsheet to a fixed version for your release line: 1.30.7, 2.1.19, 2.4.8 or 3.10.8.

## Is CVE-2026-108358 being exploited?

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

## Fix prompt for AI coding agents

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

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

Affected packages and fixed versions:
- phpoffice/phpspreadsheet (Packagist): affected all versions; fixed in 1.30.7
- phpoffice/phpspreadsheet (Packagist): affected all versions; fixed in 1.30.7
- phpoffice/phpspreadsheet (Packagist): affected from 2.0.0; fixed in 2.1.19
- phpoffice/phpspreadsheet (Packagist): affected from 2.0.0; fixed in 2.1.19
- phpoffice/phpspreadsheet (Packagist): affected from 2.2.0; fixed in 2.4.8
- phpoffice/phpspreadsheet (Packagist): affected from 2.2.0; fixed in 2.4.8
- 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-108358/ (Markdown: https://insights.sbomify.com/CVE-2026-108358/index.md)
```

## Sources

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

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