CVE-2024-45293
published high CVSS 3.1 · 7.5XML External Entity Reference (XXE) in PHPSpreadsheet's XLSX reader
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| PHPOffice | — | PhpSpreadsheet>= 2.2.0, < 2.3.0 · < 1.29.1 · >= 2.0.0, < 2.1.1 | Affected | Not stated | GitHub_M |
| phpoffice | — | phpspreadsheet2.2.0 to < 2.3.0 · 0 to < 1.29.1 · 2.0.0 to < 2.1.1 · Other versions: unknown | Affected | Not stated | CISA-ADP |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| PHPOffice | PhpSpreadsheet | >= 2.2.0, < 2.3.0 (affected)< 1.29.1 (affected)>= 2.0.0, < 2.1.1 (affected) | GitHub_M · cna |
| phpoffice | phpspreadsheet | 2.2.0 to < 2.3.0 (affected · custom)0 to < 1.29.1 (affected · custom)2.0.0 to < 2.1.1 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
1- CWE-611 CWE-611: Improper Restriction of XML External Entity Reference
References
1Provider assertions
2GitHub_M · cna
XML External Entity Reference (XXE) in PHPSpreadsheet's XLSX reader
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 036e03e7078843618c49d5ae6d8338171340d9ffcc2528c86e43c7f0410a2932
- Ingested
- 23 Sep 2026, 08:27:47 UTC
- Source record
- Official CVE record