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

exploitDog

github логотип

GHSA-r8w8-74ww-j4wh

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

Описание

PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via JavaScript hyperlinks

Summary

\PhpOffice\PhpSpreadsheet\Writer\Html does not sanitize "javascript:" URLs from hyperlink href attributes, resulting in a Cross-Site Scripting vulnerability.

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 and click on both links. The first demonstrates the vulnerability in a regular hyperlink and the second in a HYPERLINK() formula.

Пакеты

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

phpoffice/phpspreadsheet

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

>= 2.2.0, < 2.3.0

2.3.0

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

phpoffice/phpspreadsheet

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

< 1.29.2

1.29.2

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

phpoffice/phpspreadsheet

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

>= 2.0.0, < 2.1.1

2.1.1

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

phpoffice/phpexcel

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

<= 1.8.2

Отсутствует

EPSS

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

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. `\PhpOffice\PhpSpreadsheet\Writer\Html` does not sanitize "javascript:" URLs from hyperlink `href` attributes, resulting in a Cross-Site Scripting vulnerability. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.

EPSS

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

4.8 Medium

CVSS4

5.4 Medium

CVSS3

Дефекты

CWE-79