Summary
PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS)
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.
| Branch | Affected |
|---|---|
| 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.
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).
Impact
Memory exhaustion (single valued cell, repeated many rows):
A non-null cell value with a huge number-rows-repeated attribute materialises millions ofCell 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
Crafted input forces the application to consume excessive CPU, memory, or other resources, degrading or denying service. Typical impact: denial of service.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
phpoffice/phpspreadsheet to 5.10.0 or later; phpoffice/phpspreadsheet to 3.10.8 or later; phpoffice/phpspreadsheet to 2.4.8 or later; phpoffice/phpspreadsheet to 2.1.19 or later; phpoffice/phpspreadsheet to 1.30.7 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-108359? CVE-2026-108359 is a high-severity uncontrolled resource consumption vulnerability in phpoffice/phpspreadsheet (composer), affecting versions >= 4.0.0, <= 5.9.0. It is fixed in 5.10.0, 3.10.8, 2.4.8, 2.1.19, 1.30.7. Crafted input forces the application to consume excessive CPU, memory, or other resources, degrading or denying service.
- Which versions of phpoffice/phpspreadsheet are affected by CVE-2026-108359? phpoffice/phpspreadsheet (composer) versions >= 4.0.0, <= 5.9.0 is affected.
- Is there a fix for CVE-2026-108359? Yes. CVE-2026-108359 is fixed in 5.10.0, 3.10.8, 2.4.8, 2.1.19, 1.30.7. Upgrade to this version or later.
- Is CVE-2026-108359 exploitable, and should I be worried? Whether CVE-2026-108359 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-108359 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-108359?
- Upgrade
phpoffice/phpspreadsheetto 5.10.0 or later - Upgrade
phpoffice/phpspreadsheetto 3.10.8 or later - Upgrade
phpoffice/phpspreadsheetto 2.4.8 or later - Upgrade
phpoffice/phpspreadsheetto 2.1.19 or later - Upgrade
phpoffice/phpspreadsheetto 1.30.7 or later
- Upgrade