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 is a PHP library for spreadsheet file manipulation. The vulnerability arises in the HTML writer component, which fails to apply htmlspecialchars escaping if a cell's formatted value differs from its original value. This difference occurs when a custom number format uses the '@' placeholder combined with extra literal characters, causing the formatted output to bypass HTML escaping. An attacker with the ability to upload spreadsheets and control cell values and number formats can exploit this to achieve stored XSS when the spreadsheet is rendered as HTML. The issue is fixed in versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4, but no direct patch links or vendor advisory details are provided in the input.
Potential Impact
Successful exploitation allows an attacker to execute stored cross-site scripting attacks by injecting malicious scripts into spreadsheet cells that are later rendered as HTML. This can lead to limited confidentiality and integrity impacts, such as theft of user session data or manipulation of displayed content. The CVSS score of 5.4 reflects a medium severity with network attack vector, low attack complexity, requiring low privileges and user interaction, and partial impact on confidentiality and integrity but no impact on availability.
Mitigation Recommendations
The vulnerability is fixed in PhpSpreadsheet versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4. Users should upgrade affected PhpSpreadsheet installations to these or later versions to remediate the issue. Since no vendor advisory or patch links are provided, confirm patch availability and upgrade guidance from the official PHPOffice PhpSpreadsheet project resources before deployment. Until patched, avoid processing untrusted spreadsheet files or displaying their HTML-rendered content to untrusted users.
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
PhpSpreadsheet is a PHP library for spreadsheet file manipulation. The vulnerability arises in the HTML writer component, which fails to apply htmlspecialchars escaping if a cell's formatted value differs from its original value. This difference occurs when a custom number format uses the '@' placeholder combined with extra literal characters, causing the formatted output to bypass HTML escaping. An attacker with the ability to upload spreadsheets and control cell values and number formats can exploit this to achieve stored XSS when the spreadsheet is rendered as HTML. The issue is fixed in versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4, but no direct patch links or vendor advisory details are provided in the input.
Potential Impact
Successful exploitation allows an attacker to execute stored cross-site scripting attacks by injecting malicious scripts into spreadsheet cells that are later rendered as HTML. This can lead to limited confidentiality and integrity impacts, such as theft of user session data or manipulation of displayed content. The CVSS score of 5.4 reflects a medium severity with network attack vector, low attack complexity, requiring low privileges and user interaction, and partial impact on confidentiality and integrity but no impact on availability.
Mitigation Recommendations
The vulnerability is fixed in PhpSpreadsheet versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4. Users should upgrade affected PhpSpreadsheet installations to these or later versions to remediate the issue. Since no vendor advisory or patch links are provided, confirm patch availability and upgrade guidance from the official PHPOffice PhpSpreadsheet project resources before deployment. Until patched, avoid processing untrusted spreadsheet files or displaying their HTML-rendered content to untrusted users.
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: 5/6/2026, 9:22:14 PM
Last enriched: 5/6/2026, 9:36:50 PM
Last updated: 5/7/2026, 2:01:05 AM
Views: 6
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.