PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via JavaScript hyperlinks
PHPOffice PhpSpreadsheet
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| phpoffice/phpspreadsheet Packagist |
|
|
| phpoffice/phpexcel Packagist |
PHPOffice PhpSpreadsheet
| Product | Affected | Fixed in |
|---|---|---|
| phpoffice/phpspreadsheet Packagist |
|
|
| phpoffice/phpexcel Packagist |
≤ 1.8.2| No fix yet |
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.
From the CVE record · GitHub_M
The PhpSpreadsheet HTML writer does not sanitize `javascript:` URLs in hyperlink `href` attributes. An attacker-controlled hyperlink in generated HTML can execute JavaScript if a user clicks it. The input does not specify authentication requirements.
Check applications using Packagist `phpoffice/phpspreadsheet` versions below 1.29.2, 2.0.0–2.1.0, or 2.2.0–2.2.x, and those using `phpoffice/phpexcel` version 1.8.2 or earlier.