Stored Cross-Site Scripting Vulnerability in PhpSpreadsheet by PhpOffice
CVE-2026-40296
What is CVE-2026-40296?
The PhpSpreadsheet library, widely used for managing spreadsheet files, has a vulnerability that affects the HTML output of cells with custom number formatting. Specifically, when a cell's formatted value is altered and conflicts with its original value—due to custom placeholders like '@'—the library fails to escape HTML characters properly. This oversight allows attackers to inject malicious scripts into web pages viewed by other users, leading to stored cross-site scripting (XSS). To protect against this vulnerability, it is crucial for users to update to the patched versions: 5.7.0, 3.10.5, 2.4.5, 2.1.16, or 1.30.4.
Affected Version(s)
PhpSpreadsheet >= 4.0.0, <= 5.6.0 <= 4.0.0, 5.6.0
PhpSpreadsheet >= 3.3.0, <= 3.10.4 <= 3.3.0, 3.10.4
PhpSpreadsheet >= 2.2.0, <= 2.4.4 <= 2.2.0, 2.4.4
