PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via JavaScript hyperlinks
Moderate severity
GitHub Reviewed
Published
Oct 7, 2024
in
PHPOffice/PhpSpreadsheet
•
Updated Oct 7, 2024
Package
Affected versions
>= 2.2.0, < 2.3.0
< 1.29.2
>= 2.0.0, < 2.1.1
Patched versions
2.3.0
1.29.2
2.1.1
Description
Published to the GitHub Advisory Database
Oct 7, 2024
Reviewed
Oct 7, 2024
Published by the National Vulnerability Database
Oct 7, 2024
Last updated
Oct 7, 2024
Summary
\PhpOffice\PhpSpreadsheet\Writer\Html
does not sanitize "javascript:" URLs from hyperlinkhref
attributes, resulting in a Cross-Site Scripting vulnerability.PoC
Example target script:
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.
References