# CVE-2024-45293: XML External Entity Reference (XXE) in PHPSpreadsheet's XLSX reader

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/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): 2.78%, higher than 86% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-10-07T15:58:52.000Z
- Modified: 2026-06-17T07:53:58.013Z
- Also known as: GHSA-6hwr-6v2f-3m88
- Weaknesses: CWE-611
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. The security scanner responsible for preventing XXE attacks in the XLSX reader can be bypassed by slightly modifying the XML structure, utilizing white-spaces. On servers that allow users to upload their own Excel (XLSX) sheets, Server files and sensitive information can be disclosed by providing a crafted sheet. The security scan function in src/PhpSpreadsheet/Reader/Security/XmlScanner.php contains a flawed XML encoding check to retrieve the input file's XML encoding in the toUtf8 function. The function searches for the XML encoding through a defined regex which looks for `encoding="*"` and/or `encoding='*'`, if not found, it defaults to the UTF-8 encoding which bypasses the conversion logic. This logic can be used to pass a UTF-7 encoded XXE payload, by utilizing a whitespace before or after the = in the attribute definition. Sensitive information disclosure through the XXE on sites that allow users to upload their own excel spreadsheets, and parse them using PHPSpreadsheet's Excel parser. This issue has been addressed in release versions 1.29.1, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.

(As written by CVE List.)

## Affected

- PHPOffice PhpSpreadsheet: >= 2.2.0, < 2.3.0; < 1.29.1; >= 2.0.0, < 2.1.1; from 2.2.0 before 2.3.0; before 1.29.1; from 2.0.0 before 2.1.1
- phpoffice/phpspreadsheet (Packagist): from 2.2.0 before 2.3.0; before 1.29.1; from 2.0.0 before 2.1.1
- phpoffice/phpexcel (Packagist): up to 1.8.2

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`

## References

- <https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-6hwr-6v2f-3m88> (exploit, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-45293> (advisory)
- <https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c> (web)
- <https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331> (web)
- <https://github.com/PHPOffice/PhpSpreadsheet/commit/949ff63e1f6413e6485f73af012d506aa81384bf> (web)
- <https://github.com/PHPOffice/PhpSpreadsheet> (package)

## Sources

- CVE List: [CVE-2024-45293](https://www.cve.org/CVERecord?id=CVE-2024-45293), CVE Terms of Use, modified 2024-10-07
- GitHub Advisory Database: [GHSA-6hwr-6v2f-3m88](https://github.com/advisories/GHSA-6hwr-6v2f-3m88), CC-BY-4.0, modified 2025-03-06
- NVD: [CVE-2024-45293](https://nvd.nist.gov/vuln/detail/CVE-2024-45293), Public domain, modified 2026-06-17

---

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