CVE-2026-40296: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in PHPOffice PhpSpreadsheet
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.
AI Analysis
Technical Summary
PhpSpreadsheet's HTML writer skips htmlspecialchars escaping when a cell's formatted value differs from the original due to custom number formats containing the '@' placeholder plus extra literal characters. This causes the formatted value to bypass HTML escaping, enabling stored cross-site scripting if an attacker controls the cell value and number format in an uploaded spreadsheet that is later converted to HTML and displayed. The vulnerability affects versions from 1.30.3 and earlier up to 5.6.0, with fixed versions released starting at 5.7.0 and corresponding updates in earlier branches.
Potential Impact
Successful exploitation allows an attacker to inject and execute arbitrary scripts in the context of users viewing the converted HTML spreadsheet, potentially leading to information disclosure or session hijacking. The CVSS 3.1 base score is 5.4 (medium), reflecting network attack vector, low attack complexity, low privileges required, user interaction needed, and partial impact on confidentiality and integrity but no impact on availability.
Mitigation Recommendations
Fixed versions are available starting at PhpSpreadsheet 5.7.0 and corresponding updates in earlier branches (3.10.5, 2.4.5, 2.1.16, 1.30.4). Users should upgrade to these versions to remediate the vulnerability. Patch status is not explicitly confirmed in the provided data; therefore, users should consult the official vendor advisory for the latest remediation guidance and confirm patch availability before deployment.
CVE-2026-40296: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in PHPOffice PhpSpreadsheet
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.
CVSS v3.1
Score 5.4medium
Affected software
pkg:composer/phpoffice/phpspreadsheetRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
PhpSpreadsheet's HTML writer skips htmlspecialchars escaping when a cell's formatted value differs from the original due to custom number formats containing the '@' placeholder plus extra literal characters. This causes the formatted value to bypass HTML escaping, enabling stored cross-site scripting if an attacker controls the cell value and number format in an uploaded spreadsheet that is later converted to HTML and displayed. The vulnerability affects versions from 1.30.3 and earlier up to 5.6.0, with fixed versions released starting at 5.7.0 and corresponding updates in earlier branches.
Potential Impact
Successful exploitation allows an attacker to inject and execute arbitrary scripts in the context of users viewing the converted HTML spreadsheet, potentially leading to information disclosure or session hijacking. The CVSS 3.1 base score is 5.4 (medium), reflecting network attack vector, low attack complexity, low privileges required, user interaction needed, and partial impact on confidentiality and integrity but no impact on availability.
Mitigation Recommendations
Fixed versions are available starting at PhpSpreadsheet 5.7.0 and corresponding updates in earlier branches (3.10.5, 2.4.5, 2.1.16, 1.30.4). Users should upgrade to these versions to remediate the vulnerability. Patch status is not explicitly confirmed in the provided data; therefore, users should consult the official vendor advisory for the latest remediation guidance and confirm patch availability before deployment.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-10T20:22:44.035Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69fbb106cbff5d8610650ae0
Added to database: 05/06/2026, 21:22:14 UTC
Last enriched: 05/14/2026, 03:49:35 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 146
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.