Mittel

Cross-Site Scripting (XSS) vulnerability in generateNavigation() function in PhpSpreadsheet

  • Veröffentlicht: 21.01.2025
  • Aktualisiert: 11.10.2026 10:22

Summary

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.

Details

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.

php
        // 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;
        }

PoC

  1. Create an XLSX file with multiple sheets : image

  2. Generate the HTML content

php
<?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();
?>
  1. Enjoy image

Impact

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.
  • ...

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket phpoffice/phpexcel <= 1.8.2 keine Korrektur
Composer-Paket phpoffice/phpspreadsheet >= 3.0.0, < 3.8.0, < 1.29.8, >= 2.0.0, < 2.1.7, >= 2.2.0, < 2.3.6 3.8.0, 1.29.8, 2.1.7, 2.3.6

Verweise

CVSS-Wert 6.1/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Schwäche (CWE)
CWE-79
Plattform
Composer
Paket
phpoffice/phpexcel, phpoffice/phpspreadsheet
Veröffentlicht
21.01.2025
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-79xx-vf93-p7cx - CC BY 4.0

Schwachstellenhistorie: phpoffice/phpexcel

Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (23) im Archiv
Einträge insgesamt
23
Erste → letzte
11.2019 02.2025
Ohne Fix
20
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 12
  • Mittel 10
  • Niedrig 1

Veröffentlichungen pro Jahr

  1. 2019: 2
  2. 2020: 0
  3. 2021: 1
  4. 2022: 1
  5. 2023: 0
  6. 2024: 10
  7. 2025: 9
  8. 2026: 0
Schweregrad:
  1. Cross-Site Scripting (XSS) vulnerability in generateNavigation() function in PhpSpreadsheet dieser Eintrag
    Mittel · 6.1 CVE-2025-22131 <= 1.8.2 keine Korrektur
  2. Hoch · 7.1 CVE-2024-56409 <= 1.8.2 keine Korrektur
  3. Hoch · 7.1 CVE-2024-56366 <= 1.8.2 keine Korrektur
  4. Hoch · 7.1 CVE-2024-56408 <= 1.8.2 keine Korrektur
  5. Hoch · 7.5 CVE-2024-48917 <= 1.8.2 keine Korrektur
  6. Hoch · 7.5 CVE-2024-47873 <= 1.8.2 keine Korrektur
  7. Hoch CVE-2015-3542 < 1.8.1 1.8.1
  8. Hoch · 7.5 CVE-2024-45293 <= 1.8.2 keine Korrektur
  9. Hoch · 8.8 CVE-2024-45048 <= 1.8.2 keine Korrektur
  10. Hoch · 8.8 CVE-2019-12331 <= 1.8.2 keine Korrektur
  11. Hoch · 8.8 CVE-2018-19277 < 1.8.2 1.8.2

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.