Cross-site Scripting (XSS) Affecting phpoffice/phpexcel package, versions >=0.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (23rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-PHPOFFICEPHPEXCEL-9299812
  • published7 Mar 2025
  • disclosed28 Aug 2024
  • creditEmil Virkki

Introduced: 28 Aug 2024

CVE-2024-45046  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

There is no fixed version for phpoffice/phpexcel.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) due to missing sanitization of the spreadsheet styling information, via the \PhpOffice\PhpSpreadsheet\Writer\Html component.

PoC

<?php

require 'vendor/autoload.php';

$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader("Xlsx");
$spreadsheet = $reader->load(__DIR__ . '/book.xlsx');

$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
print($writer->generateHTMLAll());

CVSS Base Scores

version 4.0
version 3.1