# CVE-2024-45046: PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via style information

- Severity: Medium 5.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.42%, higher than 38% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-08-28T20:41:23.628Z
- Modified: 2026-06-17T07:53:29.307Z
- Also known as: GHSA-wgmf-q9vr-vww6
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. In affected versions `\PhpOffice\PhpSpreadsheet\Writer\Html` doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page. As a result an attacker may used a crafted spreadsheet to fully takeover a session of a user viewing spreadsheet files as HTML. This issue has been addressed in release version 2.1.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.

(As written by CVE List.)

## Affected

- PHPOffice PhpSpreadsheet: < 2.1.0; before 1.29.1; from 2.0.0 before 2.1.0
- phpspreadsheet_project phpspreadsheet: before 2.1.0
- phpoffice/phpspreadsheet (Packagist): from 2.0.0 before 2.1.0; before 1.29.1
- phpoffice/phpexcel (Packagist): up to 1.8.2

## Every score

- GitHub_M: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-wgmf-q9vr-vww6> (exploit, third-party-advisory, web)
- <https://github.com/PHPOffice/PhpSpreadsheet/pull/3957> (issue-tracking, patch, web)
- <https://github.com/PHPOffice/PhpSpreadsheet/commit/f7cf378faed2e11cf4825bf8bafea4922ae44667> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-45046> (advisory)
- <https://github.com/PHPOffice/PhpSpreadsheet> (package)

## Sources

- CVE List: [CVE-2024-45046](https://www.cve.org/CVERecord?id=CVE-2024-45046), CVE Terms of Use, modified 2024-08-29
- GitHub Advisory Database: [GHSA-wgmf-q9vr-vww6](https://github.com/advisories/GHSA-wgmf-q9vr-vww6), CC-BY-4.0, modified 2025-03-06
- NVD: [CVE-2024-45046](https://nvd.nist.gov/vuln/detail/CVE-2024-45046), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-45046 · Whole record: https://cve.day/CVE-2024-45046.json · Rebuilt by cve.day 2026-11-25T22:58:44.841Z
