Skip to content
Fencer Vulns
medium 5.4

CVE-2026-40296 json

PhpSpreadsheet vulnerable to XSS in HTML writer via custom number format codes

published 2026-04-28 6 mo ago modified 2026-10-26 13 d ago also GHSA-hrmw-qprp-wgmc , EUVD-2026-28221

cvss
5.4
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.2%
EPSS 0.2% chance of exploitation in 30 days, percentile 13%
public exploits
0
none known

Summary

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.

Patch / fix

  • packagist phpoffice/phpspreadsheet 1.30.4, 2.1.16, 2.4.5, 3.10.5, 5.7.0
  • phpoffice phpspreadsheet 1.30.4, 2.1.16, 2.4.5, 3.10.5, 5.7.0

CISA SSVC

Exploitation
Proof of concept is public
Automatable
no
Technical impact
partial
Assessed
6 mo ago

Exploit prediction

0.22% chance of exploitation in the next 30 days, higher than 13% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-hrmw-qprp-wgmc referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 5.4 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
GitHub 3.1 5.4 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Affected packages

ecosystem package affected fixed in
packagist phpoffice/phpspreadsheet
>=4.0.0, <5.7.0
>=3.3.0, <3.10.5
>=2.2.0, <2.4.5
>=2.0.0, <2.1.16
<1.30.4
5.7.0
3.10.5
2.4.5
2.1.16
1.30.4

Affected products

  • PHPOffice PhpSpreadsheet

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.