Skip to main content

CVE-2026-108359 — Vulnerability in phpoffice/phpspreadsheet

HIGH

PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS)

Published October 27, 2026Updated October 27, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.72%). Schedule for your next planned update.

Does your project use an affected phpoffice/phpspreadsheet version?

Paste your composer.lock to check it for CVE-2026-108359 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my composer.lock

Summary

Summary

When PhpSpreadsheet loads an OpenDocument Spreadsheet (.ods), Ods::processTableRow() reads the table:number-rows-repeated attribute of a <table:table-row> with an unchecked (int) cast, then materialises one cell per repeated row. This value is completely unbounded, so a single ~1.4 KB file can instruct the reader to create up to millions of cells, exhausting memory (fatal OOM). No authentication, no special configuration, and the default read filter are required - any application that loads a user-supplied .ods is affected.


Affected versions

The number-rows-repeated expansion has existed in the ODS reader since its inception (pre-dating the current release branches), so all maintained lines are affected.

BranchAffected
1.x≤ 1.30.6
2.0–2.1≤ 2.1.18
2.2–2.4≤ 2.4.7
3.x≤ 3.10.7
4.x–5.x≤ 5.9.0 (latest)

Root cause (source → sink)

src/PhpSpreadsheet/Reader/Ods.php:

// line 816 — row repeat, unchecked (int) cast
$rowRepeats = (int) $childNode->getAttributeNS($tableNs, 'number-rows-repeated');
...
// line 1151 — row materialisation loop: NO upper bound
for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) {
    $rID = $rowID + $rowAdjust;
    $cell = $spreadsheet->getActiveSheet()->getCell($columnID . $rID);  // allocates a Cell
    $cell->setValueExplicit($dataValue, $type);
    // ... no bounds check on $rowAdjust or $rID ...
}

Why columns are NOT vulnerable (already bounded):

The column-header loop at line 1326 shows the correct pattern with bounds checking:

// line 1326 (processTableColumnHeader): BOUNDED correctly
for ($rowRepeats2 = $rowRepeats; $rowRepeats2 > 0 && $tableColumnIndex2 <= AddressRange::MAX_COLUMN_INT; --$rowRepeats2) {
    // HAS BOUNDS CHECK: && $tableColumnIndex2 <= AddressRange::MAX_COLUMN_INT
}

Additionally, the cell-data column loop at line 1141 calls getCell() which throws exception at Coordinate.php:448 when column exceeds MAX_COLUMN_INT (XFD / 16,384):

// Coordinate.php line 448
if ($columnIndex > self::MAX_COLUMN_INT) {
    throw new Exception('Column string index can not be beyond XFD');
}

Result: Columns are capped at 16,384. Only rows are unbounded.


Impact

Memory exhaustion (single valued cell, repeated many rows):
A non-null cell value with a huge number-rows-repeated attribute materialises millions of Cell objects → PHP fatal Allowed memory size ... exhausted.

Example:

  • Payload: <table:table-row table:number-rows-repeated="5000000"> (5 million rows)
  • File size: 1.4 KB
  • Memory consumed: ~256 MB (one Cell object per row)
  • Result: OOM at default memory limit

Reproduction

Vulnerable payload (causes OOM):

<table:table table:name="Sheet1">
 <table:table-row table:number-rows-repeated="5000000">
  <table:table-cell office:value-type="float" office:value="1">
   <text:p>1</text:p>
  </table:table-cell>
 </table:table-row>
</table:table>

Not vulnerable (for reference - throws exception):

<table:table table:name="Sheet1">
 <table:table-row>
  <table:table-cell office:value-type="float" office:value="1"
      table:number-columns-repeated="1000000000">
   <text:p>1</text:p>
  </table:table-cell>
 </table:table-row>
</table:table>

This column-repeat example throws Column string index can not be beyond XFD exception (bounded defense, already in place).

Advisory Timeline

  • First published October 27, 2026 (30 days ago).
  • Last revised October 27, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update phpoffice/phpspreadsheet to 1.30.7 or later
composer require "phpoffice/phpspreadsheet:^1.30.7"
Composer
Update phpoffice/phpspreadsheet to 2.1.19 or later
composer require "phpoffice/phpspreadsheet:^2.1.19"
Composer
Update phpoffice/phpspreadsheet to 3.10.8 or later
composer require "phpoffice/phpspreadsheet:^3.10.8"
Composer
Update phpoffice/phpspreadsheet to 2.4.8 or later
composer require "phpoffice/phpspreadsheet:^2.4.8"
Composer
Update phpoffice/phpspreadsheet to 5.10.0 or later
composer require "phpoffice/phpspreadsheet:^5.10.0"

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (5)

Affects 1 ecosystem: Packagist (1).

PackageFixed In
phpoffice/phpspreadsheet Packagist · Affected: 1.0.0, 1.0.0-beta, 1.0.0-beta2, 1.1.0 (+60 more)1.30.7
phpoffice/phpspreadsheet Packagist · Affected: 2.0.0, 2.1.0, 2.1.1, 2.1.10 (+15 more)2.1.19
phpoffice/phpspreadsheet Packagist · Affected: 3.10.0, 3.10.1, 3.10.2, 3.10.3 (+14 more)3.10.8
phpoffice/phpspreadsheet Packagist · Affected: 2.2.0, 2.2.1, 2.2.2, 2.3.0 (+17 more)2.4.8
phpoffice/phpspreadsheet Packagist · Affected: 4.0.0, 4.1.0, 4.2.0, 4.3.0 (+14 more)5.10.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

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

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Frequently Asked Questions

What is CVE-2026-108359?
PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS). This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2026-108359?
CVE-2026-108359 affects phpoffice/phpspreadsheet. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-108359 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.72%
EPSS percentile: 49.5

This is a below-median EPSS score — only 49.5% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-j2w7-387v-m2rq

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my composer.lock