Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40296: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in PHPOffice PhpSpreadsheet

0
Medium
VulnerabilityCVE-2026-40296cvecve-2026-40296cwe-79
Published: Wed May 06 2026 (05/06/2026, 20:48:34 UTC)
Source: CVE Database V5
Vendor/Project: PHPOffice
Product: 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

AILast updated: 05/06/2026, 21:36:50 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses