CVE-2026-40296
MEDIUM 5.4CVSS 3.1PhpSpreadsheet has XSS via number format code with @ text placeholder bypasses htmlspecialchars in HTML writer
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.
- Published
- 6 May 2026
- Last modified
- 26 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-79
- Also known as
- GHSA-hrmw-qprp-wgmc
- Sources
- NVDJSONOSV GHSA-hrmw-qprp-wgmcJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | phpoffice | phpspreadsheetcpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* |
< 1.30.4 | 1.30.4 |
| NVD | phpoffice | phpspreadsheetcpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* |
>= 2.0.0, < 2.1.16 | 2.1.16 |
| NVD | phpoffice | phpspreadsheetcpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* |
>= 2.2.0, < 2.4.5 | 2.4.5 |
| NVD | phpoffice | phpspreadsheetcpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* |
>= 3.3.0, < 3.10.5 | 3.10.5 |
| NVD | phpoffice | phpspreadsheetcpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* |
>= 4.0.0, < 5.7.0 | 5.7.0 |
| OSV | Packagist | phpoffice/phpspreadsheet | >= 4.0.0, < 5.7.0 | 5.7.0 |
| OSV | Packagist | phpoffice/phpspreadsheet | >= 3.3.0, < 3.10.5 | 3.10.5 |
| OSV | Packagist | phpoffice/phpspreadsheet | >= 2.2.0, < 2.4.5 | 2.4.5 |
| OSV | Packagist | phpoffice/phpspreadsheet | >= 2.0.0, < 2.1.16 | 2.1.16 |
| OSV | Packagist | phpoffice/phpspreadsheet | < 1.30.4 | 1.30.4 |
References
- https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-hrmw-qprp-wgmc · Exploit, Mitigation, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-40296 · ADVISORY
- https://github.com/PHPOffice/PhpSpreadsheet · PACKAGE
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 6 May 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 28 Apr 2026)