Loading advisory.
Loading advisory.
Cross-Site Scripting (XSS) vulnerability in generateNavigation() function in PhpSpreadsheet
The researcher discovered zero-day vulnerability Cross-Site Scripting (XSS) vulnerability in the code which translates the XLSX file into a HTML representation and displays it in the response.
Published 2025-01-20 15:31 UTC · Modified 2025-03-06 18:37 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| phpoffice/phpspreadsheet | Packagist | >= 3.0.0, < 3.8.0 < 1.29.8 >= 2.0.0, < 2.1.7 >= 2.2.0, < 2.3.6 versions 3.3.0, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 1.0.0, 1.0.0-beta, 1.0.0-beta2, 1.1.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.14.0, 1.14.1, 1.15.0, 1.16.0, 1.17.0, 1.17.1 and 52 more | 3.8.0, 1.29.8, 2.1.7, 2.3.6 | composer require 'phpoffice/phpspreadsheet:>=3.8.0'composer require 'phpoffice/phpspreadsheet:>=1.29.8'composer require 'phpoffice/phpspreadsheet:>=2.1.7'composer require 'phpoffice/phpspreadsheet:>=2.3.6' |
| phpoffice/phpexcel | Packagist | <= 1.8.2 versions 1.7.9, 1.7.9-rc1, 1.8.0, 1.8.0rc1, 1.8.0rc2, 1.8.0rc3, 1.8.0rc4, 1.8.1, 1.8.2 | No patch yet | No command until a fix exists. |
The researcher discovered zero-day vulnerability Cross-Site Scripting (XSS) vulnerability in the code which translates the XLSX file into a HTML representation and displays it in the response.
When generating the HTML from an xlsx file containing multiple sheets, a navigation menu is created. This menu includes the sheet names, which are not sanitized. As a result, an attacker can exploit this vulnerability to execute JavaScript code.
// Construct HTML
$html = '';
// Only if there are more than 1 sheets
if (count($sheets) > 1) {
// Loop all sheets
$sheetId = 0;
$html .= '<ul class="navigation">' . PHP_EOL;
foreach ($sheets as $sheet) {
$html .= ' <li class="sheet' . $sheetId . '"><a href="#sheet' . $sheetId . '">' . $sheet->getTitle() . '</a></li>' . PHP_EOL;
++$sheetId;
}
$html .= '</ul>' . PHP_EOL;
}Create an XLSX file with multiple sheets : image
Generate the HTML content
<?php
require __DIR__ . '/vendor/autoload.php';
$inputFileName = 'payload.xlsx';
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
$writer->writeAllSheets();
echo $writer->generateHTMLAll();
?>Enjoy image
XSS can cause a variety of problems for the end user that range in severity from an annoyance to complete account compromise. Example of impacts :
Disclosure of the user’s session cookie, allowing an attacker to hijack the user’s session and take over the account (Only if HttpOnly cookie's flag is set to false).
Redirecting the user to some other page or site (like phishing websites)
Modifying the content of the current page (add a fake login page that sends credentials to the attacker).
Automatically download malicious files.
Requests access to the victim geolocation / camera.
...
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.004 on 2026-11-24 to 0.005 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |
| 2026-11-26 | 0.005 | 0.004 | v2026.06.15 |