CVE-2026-40902
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.
Weakness
- CWE-770: Allocation of Resources Without Limits or Throttling
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | yes |
| Technical impact | partial |
| Scored | 2026-05-13 |
Timeline
- 2026-04-29GitHub advisory published (GHSA-7c6m-4442-2x6m)13 days before publication
- 2026-05-12Published by the CNA22:02 UTC
- 2026-05-13CISA SSVC decision recorded1 day after publication
Exploit and advisory records
GitHub advisory GHSA-7c6m-4442-2x6m, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| Packagist phpoffice/phpspreadsheet | before 1.30.4 | 1.30.4 |
| Packagist phpoffice/phpspreadsheet | from 2.0.0 before 2.1.16 | 2.1.16 |
| Packagist phpoffice/phpspreadsheet | from 2.2.0 before 2.4.5 | 2.4.5 |
| Packagist phpoffice/phpspreadsheet | from 3.3.0 before 3.10.5 | 3.10.5 |
| Packagist phpoffice/phpspreadsheet | from 4.0.0 before 5.7.0 | 5.7.0 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| phpoffice phpspreadsheet | before 1.30.4fixed in 1.30.4from 2.0.0 before 2.1.16fixed in 2.1.16from 2.2.0 before 2.4.5fixed in 2.4.5from 3.3.0 before 3.10.5fixed in 3.10.5from 4.0.0 before 5.7.0fixed in 5.7.0 | 1.30.42.1.162.4.53.10.55.7.0 |
References
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-40902'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-40902'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-40902'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-40902'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).