CVE-2019-12331
XXE in PHPSpreadsheet due to incomplete fix for previous encoding issue
Also known as GHSA-vvwv-h69m-wg6f
Published 7 y ago · modified 4 mo ago · JSON
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.
Exploit prediction (EPSS)
1.35% probability of exploitation in the next 30 days, higher than 72% of all scored CVEs.
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/blob/master/CHANGELOG.md#180---2019-07-01 · x_refsource_CONFIRM, x_transferred
- herolab.usd.de /security-advisories/usd-2019-0046/ · x_refsource_MISC, x_transferred
- nvd.nist.gov /vuln/detail/CVE-2019-12331 · advisory
- github.com /PHPOffice/PhpSpreadsheet/pull/1041 · web
- github.com /PHPOffice/PhpSpreadsheet/commit/0e6238c69e863b58aeece61e48ea032696c6dccd · web
- 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
vulnwire keeps one entry per vulnerability: the CVE id wins, then GHSA; records that alias each other are merged. Machine-readable: JSON.