Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-wgmf-q9vr-vww6

Опубликовано: 29 авг. 2024
Источник: github
Github: Прошло ревью
CVSS4: 4.8
CVSS3: 5.4

Описание

PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via style information

Summary

\PhpOffice\PhpSpreadsheet\Writer\Html doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page.

PoC

Example target script:

<?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());

Save this file in the same directory: book.xlsx

Open index.php in a web browser. An alert should be displayed.

Impact

Full takeover of the session of users viewing spreadsheet files as HTML.

Пакеты

Наименование

phpoffice/phpspreadsheet

composer
Затронутые версииВерсия исправления

>= 2.0.0, < 2.1.0

2.1.0

Наименование

phpoffice/phpspreadsheet

composer
Затронутые версииВерсия исправления

< 1.29.1

1.29.1

Наименование

phpoffice/phpexcel

composer
Затронутые версииВерсия исправления

<= 1.8.2

Отсутствует

EPSS

Процентиль: 48%
0.00245
Низкий

4.8 Medium

CVSS4

5.4 Medium

CVSS3

Дефекты

CWE-79

Связанные уязвимости

CVSS3: 5.4
nvd
больше 1 года назад

PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. In affected versions `\PhpOffice\PhpSpreadsheet\Writer\Html` doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page. As a result an attacker may used a crafted spreadsheet to fully takeover a session of a user viewing spreadsheet files as HTML. This issue has been addressed in release version 2.1.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.

EPSS

Процентиль: 48%
0.00245
Низкий

4.8 Medium

CVSS4

5.4 Medium

CVSS3

Дефекты

CWE-79