CVE-2026-40296
Description
PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. The HTML writer skips htmlspecialchars escaping when a cell's formatted value differs from the original value. When a cell has a custom number format containing the text placeholder @ along with any additional literal characters (for example ". @", "@ ", or "x@"), the formatter replaces @ with the cell value and adds the extra characters, causing the formatted value to differ from the original and bypassing HTML escaping entirely. An attacker who can control the cell value and number format of an uploaded spreadsheet that is later converted to HTML and displayed to other users can achieve stored cross-site scripting. This issue is fixed in versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4.
Weakness
- CWE-79: Improper Neutralization of Input During Web Page Generation
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | no |
| Technical impact | partial |
| Scored | 2026-05-07 |
Timeline
- 2026-04-28GitHub advisory published (GHSA-hrmw-qprp-wgmc)8 days before publication
- 2026-05-06Published by the CNA20:48 UTC
- 2026-05-07CISA SSVC decision recorded1 day after publication
Exploit and advisory records
GitHub advisory GHSA-hrmw-qprp-wgmc, 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-40296'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-40296'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-40296'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-40296'
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).