Unauthenticated Cross-Site-Scripting (XSS) in sample file in PHPSpreadsheet
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. One of the sample scripts in PhpSpreadsheet is susceptible to a cross-site scripting (XSS) vulnerability due to improper handling of input where a number is expected leading to formula injection. The code in in `45_Quadratic_equation_solver.php` concatenates the user supplied parameters directly into spreadsheet formulas. This allows an attacker to take control over the formula and output unsanitized data into the page, resulting in JavaScript execution. 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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| PHPOffice | PhpSpreadsheet | before 1.29.2; 2.0.0 to before 2.1.1; 2.2.0 to before 2.3.0 | 1.29.2, 2.1.1, 2.3.0 | Patch available | CNA |
| — | phpoffice/phpspreadsheet (Packagist) | 2.2.0 to before 2.3.0 | 2.3.0 | Patch available | GHSA-v66g-p9x6-v98p |
| — | phpoffice/phpspreadsheet (Packagist) | before 1.29.2 | 1.29.2 | Patch available | GHSA-v66g-p9x6-v98p |
| — | phpoffice/phpspreadsheet (Packagist) | 2.0.0 to before 2.1.1 | 2.1.1 | Patch available | GHSA-v66g-p9x6-v98p |
| — | phpoffice/phpexcel (Packagist) | up to 1.8.2 | — | No fix listed | GHSA-v66g-p9x6-v98p |
- PhpSpreadsheet VendorPHPOffice Affected before 1.29.2; 2.0.0 to before 2.1.1; 2.2.0 to before 2.3.0 Fixed in 1.29.2, 2.1.1, 2.3.0 Patch available CNA
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 2.2.0 to before 2.3.0 Fixed in 2.3.0 Patch available GHSA-v66g-p9x6-v98p
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected before 1.29.2 Fixed in 1.29.2 Patch available GHSA-v66g-p9x6-v98p
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 2.0.0 to before 2.1.1 Fixed in 2.1.1 Patch available GHSA-v66g-p9x6-v98p
- phpoffice/phpexcel (Packagist) Vendor— Affected up to 1.8.2 Fixed in — No fix listed GHSA-v66g-p9x6-v98p
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* | before 1.29.2; 2.0.0 to before 2.1.1; 2.2.0 to before 2.3.0 | Vulnerable | PHPOffice |
- cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* Versions before 1.29.2; 2.0.0 to before 2.1.1; 2.2.0 to before 2.3.0 Vulnerable ·PHPOffice
Remediation
- Fix · CNA PhpSpreadsheet (PHPOffice) Fixed in 1.29.2, 2.1.1, 2.3.0
- Fix · GHSA-v66g-p9x6-v98p phpoffice/phpspreadsheet (Packagist) Fixed in 2.3.0 Advisory →
- Fix · GHSA-v66g-p9x6-v98p phpoffice/phpspreadsheet (Packagist) Fixed in 1.29.2 Advisory →
- Fix · GHSA-v66g-p9x6-v98p phpoffice/phpspreadsheet (Packagist) Fixed in 2.1.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-45060
- 2026-10-03 Alias added: GHSA-v66g-p9x6-v98p
References
Other 5
- https://github.com/PHPOffice/PhpSpreadsheet/blob/d50b8b5de7e30439fb57eae7df9ea90e79fa0f2d/samples/Basic/45_Quadratic_equation_solver.php#L56
- https://github.com/PHPOffice/PhpSpreadsheet/commit/3990173db1207767139e63d33783beafada57007
- https://github.com/PHPOffice/PhpSpreadsheet/commit/bc74f3aa1d76f191c6c7c3631e286abb25c38759
- https://github.com/PHPOffice/PhpSpreadsheet/commit/fb42a103f14cfce258c836b31f4a71f1fb1a9747
- https://github.com/PHPOffice/PhpSpreadsheet
More PHPOffice Phpspreadsheet vulnerabilities
- TI-2026-26406 PhpSpreadsheet SSRF and RCE via PHP stream wrappers in IOFactory::load CVSS 4.0CRITICAL 9.2
- TI-2024-37339 PhpSpreadsheet vulnerable to unauthorized reflected XSS in Currency.php file CVSS 4.0HIGH 8.3
- TI-2024-37338 PhpSpreadsheet allows unauthorized reflected XSS in `Convert-Online.php` file CVSS 4.0HIGH 8.3
- TI-2024-37325 PhpSpreadsheet vulnerable to unauthorized reflected XSS in the Accounting.php file CVSS 4.0HIGH 8.3
- TI-2024-37324 PhpSpreadsheet vulnerable to unauthorized reflected XSS in the constructor of the Downloader class CVSS 4.0HIGH 8.3
- TI-2024-30160 XML External Entity Reference (XXE) in PHPSpreadsheet CVSS 3.1HIGH 8.8
Sources
- CVE-2024-45060 · CVE Program
- CVE-2024-45060 · NVD
- FIRST EPSS
- GHSA-v66g-p9x6-v98p · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences