8.8high

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

CVSS
8.8
v3.1 · NVD
CISA KEV
No
not known exploited
EPSS
1.4%
percentile 72%
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.

Exploit prediction (EPSS)

1.35% probability of exploitation in the next 30 days, higher than 72% of all scored CVEs.

CVSS scores

Assigned byVersionScoreVector
NVD3.18.8CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD2.06.8AV:N/AC:M/Au:N/C:P/I:P/A:P
GitHub3.18.8CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected packages

EcosystemPackageAffectedFixed in
packagistphpoffice/phpspreadsheet
<1.8.0
1.8.0
packagistphpoffice/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

vulnwire keeps one entry per vulnerability: the CVE id wins, then GHSA; records that alias each other are merged. Machine-readable: JSON.