CVE-2026-40296Phpoffice Phpspreadsheet
Medium 5.4
Follow: this CVE · Phpoffice · Phpoffice Phpspreadsheet We alert you by email or Slack (account required).
- Priority
- 32
- CVSS 3.1
- 5.4
- EPSS
- —
- Auth required
- Yes
- Published
- May 6, 2026
- Updated
- Oct 26, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-79
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Phpspreadsheet.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Packagist | phpoffice/phpspreadsheet |
≥ 4.0.0 < 5.7.0 |
5.7.0 |
composer require "phpoffice/phpspreadsheet:^5.7.0" |
| Packagist | phpoffice/phpspreadsheet |
≥ 3.3.0 < 3.10.5 |
3.10.5 |
composer require "phpoffice/phpspreadsheet:^3.10.5" |
| Packagist | phpoffice/phpspreadsheet |
≥ 2.2.0 < 2.4.5 |
2.4.5 |
composer require "phpoffice/phpspreadsheet:^2.4.5" |
| Packagist | phpoffice/phpspreadsheet |
≥ 2.0.0 < 2.1.16 |
2.1.16 |
composer require "phpoffice/phpspreadsheet:^2.1.16" |
| Packagist | phpoffice/phpspreadsheet |
< 1.30.4 |
1.30.4 |
composer require "phpoffice/phpspreadsheet:^1.30.4" |
Per OSV / GitHub Advisories (GHSA-hrmw-qprp-wgmc). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| phpoffice | phpspreadsheet | < 1.30.4 |
| phpoffice | phpspreadsheet | ≥ 2.0.0 < 2.1.16 |
| phpoffice | phpspreadsheet | ≥ 2.2.0 < 2.4.5 |
| phpoffice | phpspreadsheet | ≥ 3.3.0 < 3.10.5 |
| phpoffice | phpspreadsheet | ≥ 4.0.0 < 5.7.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Exploit Mitigation Vendor Advisory