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.

Severity
MEDIUM
CVSS v3
5.4
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N · source cna
Exploit chance (EPSS)
0.225%
chance of exploitation in the next 30 days
higher than 13.3% of scored CVEs · 2026-11-17
CISA KEV
Not listed
Public exploit code
Yes
Exploit references (NVD and CNA): 1
Metasploit modules: 0
Nuclei templates: 0

Weakness

CISA SSVC decision points

Exploitationpoc
Automatableno
Technical impactpartial
Scored2026-05-07

Timeline

  1. 2026-04-28GitHub advisory published (GHSA-hrmw-qprp-wgmc)8 days before publication
  2. 2026-05-06Published by the CNA20:48 UTC
  3. 2026-05-07CISA SSVC decision recorded1 day after publication

The timeline shows what already happened. To be told when this CVE changes next, watch it from the API.

Exploit and advisory records

GitHub advisory GHSA-hrmw-qprp-wgmc, affected packages:

PackageVulnerable versionsFixed in
Packagist phpoffice/phpspreadsheetbefore 1.30.41.30.4
Packagist phpoffice/phpspreadsheetfrom 2.0.0 before 2.1.162.1.16
Packagist phpoffice/phpspreadsheetfrom 2.2.0 before 2.4.52.4.5
Packagist phpoffice/phpspreadsheetfrom 3.3.0 before 3.10.53.10.5
Packagist phpoffice/phpspreadsheetfrom 4.0.0 before 5.7.05.7.0

Affected products

Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.

ProductVulnerable versionsFixed in
phpoffice phpspreadsheetbefore 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.01.30.42.1.162.4.53.10.55.7.0

Products and versions as NVD and the vendor that published the CVE list them.

References

Get more CVE data from the API.

Free without a key or signup. Pro adds monitoring and higher limits: pricing.

Sources