Stored XSS via conditional HTML escaping bypass
Published May 6, 2026 · Updated May 6, 2026
Stored XSS in the HTML writer in PHPOffice PhpSpreadsheet affected releases allows remote authenticated users to inject script via XLSX files. Writer/Html.php applies htmlspecialchars only when formatted cell data equals the original, so a custom number format that adds literals around @ suppresses escaping of the cell value. Exploitation requires control of an uploaded spreadsheet's cell value and number format, conversion through the HTML writer, and another user's viewing of the generated HTML.
Summary
What happened
Stored XSS in the HTML writer in PHPOffice PhpSpreadsheet affected releases allows remote authenticated users to inject script via XLSX files. Writer/Html.php applies htmlspecialchars only when formatted cell data equals the original, so a custom number format that adds literals around @ suppresses escaping of the cell value. Exploitation requires control of an uploaded spreadsheet's cell value and number format, conversion through the HTML writer, and another user's viewing of the generated HTML.
The record
- CVE
- CVE-2026-40296
- Published
- May 6, 2026
- Updated
- May 6, 2026
- Vendor
- PHPOffice
- Product
- PhpSpreadsheet
- Classifications
- CWE-79, T1203
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- May 6, 2026CVE publishedPublication date reported by the CVE source.
- May 6, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=<= 1.30.3
- Affected versionversion=>= 2.0.0, <= 2.1.15
- Affected versionversion=>= 2.2.0, <= 2.4.4
- Affected versionversion=>= 3.3.0, <= 3.10.4
- Affected versionversion=>= 4.0.0, <= 5.6.0
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- GHSA-hrmw-qprp-wgmc proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo