CVE-2026-40296

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

MEDIUM
5.4
CVSS Score
Published: May 6, 2026 at 08:48 PM UTC
Updated: June 17, 2026 at 10:44 AM UTC
1 product affected across 1 vendorPhpSpreadsheet

Using PhpSpreadsheet by PHPOffice?

Get instant alerts when new vulnerabilities affect PhpSpreadsheet - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.4
Exploit prediction
EPSS 0.2%
SSVC
PoC

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≤ 2.1.15v ≤ 2.4.4v ≤ 3.10.4v ≤ 5.6.0v < 1.30.42.0.0 ≤ v < 2.1.162.2.0 ≤ v < 2.4.53.3.0 ≤ v < 3.10.54.0.0 ≤ v < 5.7.0<= 1.30.3

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (1)

x_refsource_CONFIRMExploitMitigationVendor Advisory
Source: cverecord
https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-hrmw-qprp-wgmc

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.4MEDIUMGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
LOW
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-79

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card