CVE-2019-12331 json
XXE in PHPSpreadsheet due to incomplete fix for previous encoding issue
published 2019-11-07 7 y ago modified 2026-06-17 4 mo ago also GHSA-vvwv-h69m-wg6f , EUVD-2019-0763
- cvss
- 8.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.4%
- EPSS 1.4% chance of exploitation in 30 days, percentile 71%
- public exploits
- 0
- none known
Summary
PHPOffice PhpSpreadsheet before 1.8.0 has an XXE issue. The XmlScanner decodes the sheet1.xml from an .xlsx to utf-8 if something else than UTF-8 is declared in the header. This was a security measurement to prevent CVE-2018-19277 but the fix is not sufficient. By double-encoding the the xml payload to utf-7 it is possible to bypass the check for the string ‚<!ENTITY‘ and thus allowing for an xml external entity processing (XXE) attack.
Patch / fix
- packagist phpoffice/phpspreadsheet 1.8.0
- phpoffice phpspreadsheet 1.8.0
Exploit prediction
1.35% chance of exploitation in the next 30 days, higher than 71% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- herolab.usd.de https://herolab.usd.de/security-advisories/usd-2019-0046/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.8 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | phpoffice/phpspreadsheet | <1.8.0 |
1.8.0 |
| packagist | phpoffice/phpexcel | <=1.8.2 |
no fix listed |
Classification
- Weakness
-
- CWE-611 Improper Restriction of XML External Entity Reference
References
-
github.com
/PHPOffice/PhpSpreadsheet/pull/1041
web
-
github.com
/PHPOffice/PhpSpreadsheet/commit/0e6238c69e863b58aeece61e48ea032696c6dccd
web
-
herolab.usd.de
/security-advisories/usd-2019-0046/
exploit, third-party-advisory
-
github.com
/PHPOffice/PhpSpreadsheet/blob/master/CHANGELOG.md#180---2019-07-01
web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2019-12331
advisory
-
github.com
/FriendsOfPHP/security-advisories/blob/master/phpoffice/phpspreadsheet/CVE-2019-12331.yaml
web
-
github.com
/PHPOffice/PhpSpreadsheet
package
-
github.com
/PHPOffice/PhpSpreadsheet/releases/tag/1.8.0
web
-
herolab.usd.de
/security-advisories/usd-2019-0046
web
Sources
- CVE List CVE-2019-12331
- GitHub Advisory GHSA-vvwv-h69m-wg6f
- NVD CVE-2019-12331
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.