XML External Entity Reference (XXE) in PHPSpreadsheet's XLSX reader
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-611 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- 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 | 2.2.0 to before 2.3.0; before 1.29.1; 2.0.0 to before 2.1.1 | 2.3.0, 1.29.1, 2.1.1 | Patch available | CNA |
| — | phpoffice/phpspreadsheet (Packagist) | 2.2.0 to before 2.3.0 | 2.3.0 | Patch available | GHSA-6hwr-6v2f-3m88 |
| — | phpoffice/phpspreadsheet (Packagist) | before 1.29.1 | 1.29.1 | Patch available | GHSA-6hwr-6v2f-3m88 |
| — | phpoffice/phpspreadsheet (Packagist) | 2.0.0 to before 2.1.1 | 2.1.1 | Patch available | GHSA-6hwr-6v2f-3m88 |
| — | phpoffice/phpexcel (Packagist) | up to 1.8.2 | — | No fix listed | GHSA-6hwr-6v2f-3m88 |
- PhpSpreadsheet VendorPHPOffice Affected 2.2.0 to before 2.3.0; before 1.29.1; 2.0.0 to before 2.1.1 Fixed in 2.3.0, 1.29.1, 2.1.1 Patch available CNA
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 2.2.0 to before 2.3.0 Fixed in 2.3.0 Patch available GHSA-6hwr-6v2f-3m88
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected before 1.29.1 Fixed in 1.29.1 Patch available GHSA-6hwr-6v2f-3m88
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 2.0.0 to before 2.1.1 Fixed in 2.1.1 Patch available GHSA-6hwr-6v2f-3m88
- phpoffice/phpexcel (Packagist) Vendor— Affected up to 1.8.2 Fixed in — No fix listed GHSA-6hwr-6v2f-3m88
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* | before 1.29.1; 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.1; 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 2.3.0, 1.29.1, 2.1.1
- Fix · GHSA-6hwr-6v2f-3m88 phpoffice/phpspreadsheet (Packagist) Fixed in 2.3.0 Advisory →
- Fix · GHSA-6hwr-6v2f-3m88 phpoffice/phpspreadsheet (Packagist) Fixed in 1.29.1 Advisory →
- Fix · GHSA-6hwr-6v2f-3m88 phpoffice/phpspreadsheet (Packagist) Fixed in 2.1.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-45293
- 2026-10-03 Alias added: GHSA-6hwr-6v2f-3m88
References
Other 4
- https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c
- https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331
- https://github.com/PHPOffice/PhpSpreadsheet/commit/949ff63e1f6413e6485f73af012d506aa81384bf
- 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-45293 · CVE Program
- CVE-2024-45293 · NVD
- FIRST EPSS
- GHSA-6hwr-6v2f-3m88 · 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