Source. This article is based on PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service (GHSA-3x94-m842-937c). Details were checked against it on November 10, 2026; check the source for later changes.
On 27 October 2026 GitHub published four advisories for PhpSpreadsheet, the Composer library many PHP apps use to read and write XLSX, ODS and other spreadsheet files. Three are rated high and one medium in the Packagist advisory feed. All four are fixed in the same releases: 1.30.7, 2.1.19, 2.4.8, 3.10.8 and 5.10.0. The most search-relevant is CVE-2026-108358 (GHSA-3x94-m842-937c), a bypass of the library's XML scanner that lets a crafted XLSX carry a DOCTYPE declaration the scanner never sees. The advisory is the primary source for this article.
If your application lets users upload spreadsheets, import customer data from Excel, or generate reports from uploaded files, this is a dependency update to schedule now.
What the four advisories describe
- CVE-2026-108358 (GHSA-3x94-m842-937c):
XmlScanner::scan()looks for<!DOCTYPEwith a regular expression that only allows NULL bytes between the characters. The advisory states that ISO-2022 escape bytes (0x1B) inserted between the characters break the match, while the XML parser strips them later. A DOCTYPE with entity definitions then passes through. Per the advisory, this gives denial of service through entity expansion on all PHP versions, and XXE or SSRF on PHP older than 8.0 or whenLIBXML_NOENTis used. It reports a roughly 2 KB file causing about 45 MB of peak memory in its own test. - CVE-2026-108357 (GHSA-rxj4-h86g-25gc): a similar scanner bypass in the SpreadsheetML XML reader (
Reader\Xml). The file content is scanned twice, and a decoding step runs after each pattern check, so a double-encoded&#60;turns into<only after both checks. The advisory lists it for 3.3.0 to 3.10.7 and 4.0.0 to 5.9.0. - CVE-2026-108359 (GHSA-j2w7-387v-m2rq): the ODS reader trusts the
table:number-rows-repeatedattribute without a limit. The advisory says a file of about 1.4 KB can make the reader create a very large number of cells and run out of memory. - CVE-2026-108360 (GHSA-2phh-27fw-q4gc): when external images are allowed, a whitelisted URL that redirects to an internal address is followed without checking the new target, which the advisory calls a blind SSRF. External images are off by default; the advisory says they need
setAllowExternalImages(true).
Who is affected and how to check
Per the advisories, the affected ranges for CVE-2026-108358, CVE-2026-108359 and CVE-2026-108360 are everything up to 1.30.6, 2.0.0 to 2.1.18, 2.2.0 to 2.4.7, 3.3.0 to 3.10.7, and 4.0.0 to 5.9.0. CVE-2026-108357 is listed only for 3.3.0 and later.
From your project root, find out which version you have and why it is installed. PhpSpreadsheet is often pulled in by another package such as an export plugin, so the second command matters.
composer show phpoffice/phpspreadsheet
composer why phpoffice/phpspreadsheet
composer audit
composer audit reports packages that match known security advisories. Once the Packagist data is current, it should list these four IDs for any vulnerable version.
Then check how you use the library. The XLSX and XML paths matter if users can upload files. The ODS path matters if you accept .ods. The SSRF issue only applies if your code calls setAllowExternalImages(true):
grep -rn "setAllowExternalImages" src/ app/ lib/
The fix
Upgrade to the first fixed release on your branch. The OSV records for these advisories list these fixed versions:
- 1.x: 1.30.7
- 2.0 to 2.1: 2.1.19
- 2.2 to 2.4: 2.4.8
- 3.x: 3.10.8
- 4.x and 5.x: 5.10.0
If your constraint already allows the fixed release, a targeted update is enough:
composer update phpoffice/phpspreadsheet --with-dependencies
If your composer.json pins an older range, raise it. For example, for the 3.x line:
composer require "phpoffice/phpspreadsheet:^3.10.8"
Check the result with composer show phpoffice/phpspreadsheet. If another package holds PhpSpreadsheet back, composer why-not phpoffice/phpspreadsheet 3.10.8 names the package whose constraint blocks it.
Which branch you can move to depends on your PHP version. We have not mapped each PhpSpreadsheet branch to PHP versions here, so read the requirements in the release notes of the version you pick before upgrading. A shop still on PHP 7.x will often land on one of the older fixed branches. That is a reason to plan the wider move covered in our guide on upgrading PHP 5, 6 and 7 to PHP 8.
If you cannot upgrade right now
The advisories we read do not publish a workaround for the scanner bypasses or the ODS issue, so we will not invent one. What follows is general risk reduction, not vendor guidance:
- Stop accepting spreadsheet uploads from anonymous users until the update is in place.
- Set a PHP
memory_limitand a request time limit on the worker that handles imports, so one bad file cannot take down the whole host. The advisories describe memory exhaustion as the main denial-of-service effect. - For the SSRF issue, leave external images switched off. They are off by default per the advisory.
- Run imports in a queue worker rather than in the web request, so an out-of-memory failure kills a job and not your site.
How to confirm the fix worked
- Run
composer show phpoffice/phpspreadsheeton each environment, including staging, CLI workers and any Docker images, and compare the version with the fixed list above. - Run
composer auditand confirm none of CVE-2026-108357, CVE-2026-108358, CVE-2026-108359 or CVE-2026-108360 is reported. - Re-run your own import tests with normal XLSX, ODS and XML files to make sure real files still load. We have not tested the patches ourselves. The maintainers state the fixes in the releases linked from the advisory.
- Make sure the deployed
composer.lockis the one that was updated. A common miss is updating a development checkout and shipping an old lock file.
When this points to a bigger legacy problem
A spreadsheet library is the kind of dependency that gets installed once and forgotten. In older PHP applications we often find it vendored by hand, copied into a lib/ folder with no Composer file at all, or held at an old version because a newer one needs a newer PHP. If composer why returns nothing and you still find the library on disk, treat that as a sign the dependency inventory is missing. Start with the checks in our legacy PHP platform security audit and add some tests around import paths first, as described in adding tests to legacy PHP code. If you want help getting dependencies and the PHP version underneath them onto supported releases, our PHP platform development team does this in staged steps. Our modernisation roadmap shows the order we usually follow.
Frequently asked questions
Which PhpSpreadsheet versions fix CVE-2026-108358?
Per the advisory data, the fixed versions are 1.30.7, 2.1.19, 2.4.8, 3.10.8 and 5.10.0, depending on your release branch.
Is my app affected if it never accepts uploads?
The advisories describe attacks through crafted XLSX, ODS or XML files. If your app only reads spreadsheets you created yourself, the exposure is lower, but updating is still sensible.
How do I check whether PhpSpreadsheet is installed through another package?
Run composer why phpoffice/phpspreadsheet in the project root. It lists the packages that require it, and composer audit reports known advisories for the installed version.
Need your PHP dependencies audited and updated safely?
We inventory libraries like PhpSpreadsheet across your servers, add tests around import paths and move them to patched versions in stages.
See our PHP Platform Development