Skip to main content

PhpSpreadsheet CVE-2026-40863

HIGH
Uncontrolled Resource Consumption (CWE-400)
2026-04-29 https://github.com/PHPOffice/PhpSpreadsheet GHSA-84wq-86v6-x5j6
7.5
CVSS 3.1 · Vendor: https://github.com/PHPOffice/PhpSpreadsheet
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload crafted SpreadsheetML XML file
  2. Delivery
    App parses via Reader\Xml
  3. Exploit
    ss:Index inflates cachedHighestRow to ~1B
  4. Execution
    getRowIterator() loops billion rows
  5. Persist
    CPU exhaustion blocks worker
  6. Impact
    Service denial for users

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application (1) uses PhpSpreadsheet's SpreadsheetML reader - either explicitly via IOFactory::createReader('Xml') or via format auto-detection on an uploaded Excel-2003-XML/.xml Workbook - on attacker-supplied input, and (2) subsequently iterates rows without specifying an explicit end row (e.g. getRowIterator() with no bound, or equivalent full-sheet processing). The trigger is a <Row> element whose ss:Index (or a cell's ss:Index) exceeds MAX_ROW=1,048,576; the ss:Hidden attribute is NOT required, since any cell data in the oversized row also inflates cachedHighestRow. No authentication, user interaction, or non-default configuration is needed (PR:N/UI:N). Limiting factor: applications that never expose the Xml/SpreadsheetML reader to untrusted files, or that always iterate with an explicit end-row bound, are not exploitable.

Impact

Signals are internally consistent and point to a genuine but bounded DoS rather than a top-tier emergency. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, C:N/I:N/A:H, score 7.5) correctly reflects remote, unauthenticated, low-complexity triggering with availability-only impact - no confidentiality or integrity loss and no code execution. EPSS is very low (0.04%, 12th percentile), the CVE is not on CISA KEV (no active exploitation), and a POC exists publicly. The high CVSS is driven entirely by the A:H availability metric; there is no memory-corruption or RCE risk. Real-world priority depends on exposure: applications that accept user-uploaded spreadsheets and process them synchronously in a web worker face a realistic single-request worker-exhaustion risk, while applications that do not expose the SpreadsheetML/Xml reader to untrusted input are largely unaffected. No conflicting signals were identified; the main unknown is real-world exploitation, which the low EPSS and absence from KEV suggest is not widespread.

Exploit ScenarioDerived

An attacker uploads a ~300-byte SpreadsheetML file containing a <Row ss:Index="999999999"> element to any endpoint that parses spreadsheets with PhpSpreadsheet's Xml reader. When the application later calls getRowIterator() (directly or via toArray-style processing), the worker begins iterating ~1 billion rows and pins a CPU core until max_execution_time kills it, blocking that PHP worker. Repeated uploads across workers can exhaust the pool and deny service to all users; a public POC is included in the advisory (AV:N/AC:L, no auth required).

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Denial of service in PhpSpreadsheet's SpreadsheetML (Excel 2003 XML) reader lets a remote unauthenticated attacker exhaust server CPU with a single ~300-byte file. The Reader\Xml component fails to bound the ss:Index row attribute against AddressRange::MAX_ROW (1,048,576), so a crafted value like ss:Index="999999999" inflates cachedHighestRow to ~1 billion; any later getRowIterator() call then attempts ~1 billion iterations. A working proof-of-concept is published in the GitHub advisory, though this is not confirmed as actively exploited and EPSS risk is negligible (0.04%).

RemediationAI

Vendor-released patch: upgrade to the fixed release for your branch - 5.7.0, 3.10.5, 2.4.5, or 2.1.16 (composer require phpoffice/phpspreadsheet:^5.7 or the appropriate branch). The fix adds MAX_ROW validation clamping ss:Index to AddressRange::MAX_ROW after reading the attribute in Reader/Xml.php. If immediate upgrade is not possible, apply the vendor's clamp as a local patch (bounding the ss:Index value for both Row and Cell elements to 1,048,576), or as a compensating control avoid invoking the Xml reader on untrusted files - restrict IOFactory::createReader('Xml')/load on the SpreadsheetML path and reject files with the urn:schemas-microsoft-com:office:spreadsheet namespace at upload time (trade-off: legitimate Excel-2003-XML uploads are blocked). Additionally, process spreadsheet parsing in an isolated worker with a strict CPU/time budget (e.g. a tight set_time_limit plus a hard external kill), noting this only limits blast radius rather than preventing the DoS. Advisory URL: https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-84wq-86v6-x5j6

Affected Packages

composer phpoffice/phpspreadsheet fix: 1.30.6, 2.1.16, 2.4.5, 3.10.5, 5.7.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PhpSpreadsheet is the widely used pure-PHP library (composer package phpoffice/phpspreadsheet) for reading and writing spreadsheet formats. The flaw is in its SpreadsheetML reader, which parses the legacy Microsoft 'Excel 2003 XML' Workbook format. Per the advisory, Reader/Xml.php casts the ss:Index attribute of a <Row> element to int with no upper-bound check and passes it to Worksheet::getRowDimension() and getCell(), each of which updates cachedHighestRow via max(). RowIterator::resetEnd() then defaults its end row to getHighestRow(), so an attacker-controlled highest-row value drives an unbounded loop. This is a textbook CWE-400 (Uncontrolled Resource Consumption): untrusted input directly sizes a computation loop with no ceiling, and the DefaultReadFilter offers no protection because it returns true for every cell.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/PHPOffice/PhpSpreadsheet) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

Remote unauthenticated processing of an uploaded file with no interaction triggers CPU exhaustion; availability-only impact (A:H) with no confidentiality or integrity effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/PHPOffice/PhpSpreadsheet).

CVSS VectorVendor: https://github.com/PHPOffice/PhpSpreadsheet

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

Summary

The SpreadsheetML XML reader (Reader\Xml) does not validate the ss:Index row attribute against the maximum allowed row count (AddressRange::MAX_ROW = 1,048,576). An attacker can craft a SpreadsheetML XML file with ss:Index="999999999" on a <Row> element, which inflates the internal cachedHighestRow to ~1 billion. Any subsequent call to getRowIterator() without an explicit end row will attempt to iterate ~1 billion rows, causing CPU exhaustion and denial of service.

Details

In src/PhpSpreadsheet/Reader/Xml.php, the loadSpreadsheetFromFile method processes <Row> elements:

php
// Xml.php:397-402
if (isset($row_ss['Index'])) {
    $rowID = (int) $row_ss['Index']; // No validation against MAX_ROW
}
if (isset($row_ss['Hidden'])) {
    $rowVisible = ((string) $row_ss['Hidden']) !== '1';
    $spreadsheet->getActiveSheet()->getRowDimension($rowID)->setVisible($rowVisible);
}

The $rowID value read from ss:Index is cast to int with no upper bound check. It is then passed to getRowDimension():

php
// Worksheet.php:1342-1351
public function getRowDimension(int $row): RowDimension
{
    if (!isset($this->rowDimensions[$row])) {
        $this->rowDimensions[$row] = new RowDimension($row);
        $this->cachedHighestRow = max($this->cachedHighestRow, $row);
    }
    return $this->rowDimensions[$row];
}

This inflates cachedHighestRow to the attacker-controlled value. Additionally, at line 412, $cellRange = $columnID . $rowID is constructed and passed to getCell(), which calls createNewCell() (Worksheet.php:1294) and also sets cachedHighestRow.

The RowIterator constructor uses getHighestRow() as its default end row:

php
// RowIterator.php:84-88
public function resetEnd(?int $endRow = null): static
{
    $this->endRow = $endRow ?: $this->subject->getHighestRow();
    return $this;
}

With cachedHighestRow at ~1 billion, iterating over rows causes CPU exhaustion. The DefaultReadFilter provides no protection - it returns true for all cells.

Even without the Hidden attribute, any cell data within the row still uses the inflated $rowID at line 412, so the ss:Hidden attribute is not required to trigger the vulnerability.

PoC

  1. Create poc.xml:
xml
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
 <Worksheet ss:Name="Sheet1">
  <Table>
   <Row ss:Index="999999999" ss:Hidden="1"/>
   <Row><Cell><Data ss:Type="String">test</Data></Cell></Row>
  </Table>
 </Worksheet>
</Workbook>
  1. Load and iterate:
php
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;

$reader = IOFactory::createReader('Xml');
$spreadsheet = $reader->load('poc.xml');
$sheet = $spreadsheet->getActiveSheet();

echo "Highest row: " . $sheet->getHighestRow() . "\n";
// Outputs: Highest row: 1000000000

// This loop will attempt ~1 billion iterations → CPU exhaustion
foreach ($sheet->getRowIterator() as $row) {
    // Never completes
}

Impact

Any PHP application that processes user-uploaded SpreadsheetML XML files using PhpSpreadsheet is vulnerable. An attacker can cause denial of service by:

  • Exhausting server CPU with a single small XML file (~300 bytes)
  • Blocking the PHP worker process, potentially affecting all concurrent users
  • Triggering PHP max_execution_time limits that still consume resources before killing the process

The attack requires no authentication - only the ability to upload or cause the application to process a crafted SpreadsheetML file.

Recommended Fix

Add MAX_ROW validation after reading the ss:Index attribute in src/PhpSpreadsheet/Reader/Xml.php:

php
// After line 398:
if (isset($row_ss['Index'])) {
    $rowID = (int) $row_ss['Index'];
    if ($rowID > AddressRange::MAX_ROW) {
        $rowID = AddressRange::MAX_ROW;
    }
}

Add the necessary import at the top of the file:

php
use PhpOffice\PhpSpreadsheet\Cell\AddressRange;

The same validation should also be applied to the ss:Index attribute on <Cell> elements (line 409) for the column dimension.

Executive ViewAI

Why It Matters

PhpSpreadsheet's XML reader fails to validate row index values, enabling remote unauthenticated attackers to trigger denial of service with a single 300-byte file. Publicly available exploit code exists, creating immediate risk for any organization processing spreadsheets. This threatens business continuity across document management systems and requires urgent patching.

Business Impact: High
Compensating Controls

Apply vendor patch. Interim: disable Excel 2003 XML (SpreadsheetML) parsing if not required; enforce file size limits (maximum 1MB); implement XML row index validation (reject >100,000); deploy WAF rules filtering suspicious XML attribute patterns.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Prevalence
High
extremely popular PHP spreadsheet library, but only Xml reader path affected
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:composer/phpoffice_phpspreadsheet
pkg:composer/phpoffice_phpspreadsheet
pkg:composer/phpoffice_phpspreadsheet
pkg:composer/phpoffice_phpspreadsheet
pkg:composer/phpoffice_phpspreadsheet

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy