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…
EPSS 0.2%top 87%

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: 05/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.

CVSS v3.1

Score 5.4medium

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Affected software

Packagistmore threats →ai
phpoffice/phpspreadsheet
pkg:composer/phpoffice/phpspreadsheet
Affected versions
<=1.30.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/14/2026, 03:49:35 UTC

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.

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: 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 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