Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. phpoffice/phpspreadsheet
  4. ›
  5. CVE-2026-40902

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

April 29, 2026

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.

References

  • github.com/PHPOffice/PhpSpreadsheet
  • github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-7c6m-4442-2x6m
  • github.com/advisories/GHSA-7c6m-4442-2x6m
  • nvd.nist.gov/vuln/detail/CVE-2026-40902

Code Behaviors & Features

Detect and mitigate CVE-2026-40902 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.30.4, all versions starting from 2.0.0 before 2.1.16, all versions starting from 2.2.0 before 2.4.5, all versions starting from 3.3.0 before 3.10.5, all versions starting from 4.0.0 before 5.7.0

Fixed versions

  • 5.7.0
  • 3.10.5
  • 2.4.5
  • 2.1.16
  • 1.30.4

Solution

Upgrade to versions 1.30.4, 2.1.16, 2.4.5, 3.10.5, 5.7.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-400: Uncontrolled Resource Consumption

Source file

packagist/phpoffice/phpspreadsheet/CVE-2026-40902.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:18:51 +0000.