PhpSpreadsheet XmlScanner bypass leads to XXE
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 PHP library for reading and writing spreadsheet files. The XmlScanner class has a scan method which should prevent XXE attacks. However, prior to versions 1.9.4, 2.1.3, 2.3.2, and 3.4.0, the regexes used in the `scan` method and the findCharSet method can be bypassed by using UCS-4 and encoding guessing. An attacker can bypass the sanitizer and achieve an XML external entity attack. Versions 1.9.4, 2.1.3, 2.3.2, and 3.4.0 fix the issue.
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 | before 1.29.4; 2.0.0 to before 2.1.3; 2.2.0 to before 2.3.2; 3.3.0 to before 3.4.0 | 1.29.4, 2.1.3, 2.3.2, 3.4.0 | Patch available | CNA |
| — | phpoffice/phpspreadsheet (Packagist) | before 1.29.4 | 1.29.4 | Patch available | GHSA-jw4x-v69f-hh5w |
| — | phpoffice/phpspreadsheet (Packagist) | 2.0.0 to before 2.1.3 | 2.1.3 | Patch available | GHSA-jw4x-v69f-hh5w |
| — | phpoffice/phpspreadsheet (Packagist) | 2.2.0 to before 2.3.2 | 2.3.2 | Patch available | GHSA-jw4x-v69f-hh5w |
| — | phpoffice/phpspreadsheet (Packagist) | 3.3.0 to before 3.4.0 | 3.4.0 | Patch available | GHSA-jw4x-v69f-hh5w |
| — | phpoffice/phpexcel (Packagist) | up to 1.8.2 | — | No fix listed | GHSA-jw4x-v69f-hh5w |
- PhpSpreadsheet VendorPHPOffice Affected before 1.29.4; 2.0.0 to before 2.1.3; 2.2.0 to before 2.3.2; 3.3.0 to before 3.4.0 Fixed in 1.29.4, 2.1.3, 2.3.2, 3.4.0 Patch available CNA
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected before 1.29.4 Fixed in 1.29.4 Patch available GHSA-jw4x-v69f-hh5w
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 2.0.0 to before 2.1.3 Fixed in 2.1.3 Patch available GHSA-jw4x-v69f-hh5w
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 2.2.0 to before 2.3.2 Fixed in 2.3.2 Patch available GHSA-jw4x-v69f-hh5w
- phpoffice/phpspreadsheet (Packagist) Vendor— Affected 3.3.0 to before 3.4.0 Fixed in 3.4.0 Patch available GHSA-jw4x-v69f-hh5w
- phpoffice/phpexcel (Packagist) Vendor— Affected up to 1.8.2 Fixed in — No fix listed GHSA-jw4x-v69f-hh5w
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* | before 1.29.4; 2.0.0 to before 2.1.3; 2.2.0 to before 2.3.2; 3.3.0 to before 3.4.0 | Vulnerable | PHPOffice |
- cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:* Versions before 1.29.4; 2.0.0 to before 2.1.3; 2.2.0 to before 2.3.2; 3.3.0 to before 3.4.0 Vulnerable ·PHPOffice
Remediation
- Fix · CNA PhpSpreadsheet (PHPOffice) Fixed in 1.29.4, 2.1.3, 2.3.2, 3.4.0
- Fix · GHSA-jw4x-v69f-hh5w phpoffice/phpspreadsheet (Packagist) Fixed in 1.29.4 Advisory →
- Fix · GHSA-jw4x-v69f-hh5w phpoffice/phpspreadsheet (Packagist) Fixed in 2.1.3 Advisory →
- Fix · GHSA-jw4x-v69f-hh5w phpoffice/phpspreadsheet (Packagist) Fixed in 2.3.2 Advisory →
- Fix · GHSA-jw4x-v69f-hh5w phpoffice/phpspreadsheet (Packagist) Fixed in 3.4.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-47873
- 2026-10-03 Alias added: GHSA-jw4x-v69f-hh5w
References
Other 4
- https://github.com/PHPOffice/PhpSpreadsheet/blob/39fc51309181e82593b06e2fa8e45ef8333a0335/src/PhpSpreadsheet/Reader/Security/XmlScanner.php
- https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing
- https://www.w3.org/TR/xml/#sec-guessing-no-ext-info
- 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-47873 · CVE Program
- CVE-2024-47873 · NVD
- FIRST EPSS
- GHSA-jw4x-v69f-hh5w · 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