CVE-2026-108359High· 8.7▾ TwilightPhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS)
▾ Twilight zone — High severity, or a signal on a lesser flaw
impact 47.8 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Oct 25.
Disclosure to exploitation, from the record and what we observed since indexing it.
0.4%
Disclosed via GHSA
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.
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) |
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.
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:
<table:table-row table:number-rows-repeated="5000000"> (5 million rows)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).
phpoffice/phpspreadsheet >= 4.0.0, <= 5.9.0phpoffice/phpspreadsheet >= 3.3.0, <= 3.10.7phpoffice/phpspreadsheet >= 2.2.0, <= 2.4.7phpoffice/phpspreadsheet >= 2.0.0, <= 2.1.18phpoffice/phpspreadsheet <= 1.30.6Upgrade to a patched release:
phpoffice/phpspreadsheet 5.10.0phpoffice/phpspreadsheet 3.10.8phpoffice/phpspreadsheet 2.4.8phpoffice/phpspreadsheet 2.1.19phpoffice/phpspreadsheet 1.30.7Connected by shared product, vendor, weakness, or advisory.
CVE-2026-108357High· 8.8PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service
CVE-2026-108360Medium· 6.4PhpSpreadsheet: SSRF whitelist bypass via unre-validated HTTP redirect in Drawing::setPath external image loading
CVE-2026-108358High· 8.8PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service
CVE-2026-40863High· 7.5PhpSpreadsheet has CPU Denial of Service via Unbounded Row Index in SpreadsheetML XML Reader
CVE-2026-59932High· 7.5PHPSpreadsheet: Gnumeric reader unbounded gzip expansion causes memory exhaustion
CVE-2026-59933High· 7.5PHPSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustion