PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via style information
Moderate severity
GitHub Reviewed
Published
Aug 28, 2024
in
PHPOffice/PhpSpreadsheet
•
Updated Sep 4, 2024
Package
Affected versions
>= 2.0.0, < 2.1.0
< 1.29.1
Patched versions
2.1.0
1.29.1
Description
Published by the National Vulnerability Database
Aug 28, 2024
Published to the GitHub Advisory Database
Aug 29, 2024
Reviewed
Aug 29, 2024
Last updated
Sep 4, 2024
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:
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.
References