KeygraphLabs · CVE MCP

CVE-2019-12331 · mitre

CVE-2019-12331

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.

Published 2019-11-07, last changed 2026-06-17. Weakness: CWE-611.

CVSS
8.8
high, from NVD
EPSS
1.35%
percentile 72.5%, chance of exploitation in 30 days
Exploitation
None known
no KEV listing or public exploit in our indexes

How to fix

Upgrade to a fixed version: phpoffice/phpspreadsheet 1.8.0 (Packagist). For the version that clears every advisory for your installed version, ask an agent for get_remediation.

Where the flaw is in the code

Fixed in PHPOffice/PhpSpreadsheet by pull request #1041, 0e6238c69e. Functions changed by the fix: __construct, shutdown, __destruct, identifyLibxmlDisableEntityLoaderAvailability, threadSafeLibxmlDisableEntityLoaderAvailability, disableEntityLoaderCheck, toUtf8, scan, getLibXmlLoaderOptions, setLibXmlDisableEntityLoader, getLibXmlDisableEntityLoader. Regression tests: tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php, tests/data/Reader/Xml/XEETestInvalidUTF-7_DoubleEncoded.xml. Confidence: verified (a record names this commit as the fix, and it changed these functions).

Timeline

2019-11-07Published
2019-11-20Package advisory GHSA-vvwv-h69m-wg6f
2026-06-17Record last changed
2026-11-30EPSS when our history starts: 1.35%
2026-12-03Code-level analysis added

Affected packages

AdvisoryPackageFixed in
GHSA-vvwv-h69m-wg6fphpoffice/phpspreadsheet (Packagist)1.8.0
GHSA-vvwv-h69m-wg6fphpoffice/phpexcel (Packagist)no fix yet

Also known as: GHSA-vvwv-h69m-wg6f

Related

CVEPublishedCVSSSummary
CVE-2026-1083602026-10-226.4PhpSpreadsheet: SSRF whitelist bypass via unre-validated HTTP redirect in Drawing::setPath external image loading
CVE-2026-1083592026-10-228.7PhpSpreadsheet ODS Reader: Unbounded number-rows-repeated → CPU & Memory Exhaustion (DoS)
CVE-2026-1083582026-10-228.8PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service
CVE-2026-1083572026-10-228.8PhpSpreadsheet: XmlScanner Bypass via Double-Encoded unentity() TOCTOU Allows XXE and Denial of Service
CVE-2026-599322026-07-287.5PhpSpreadsheet: Gnumeric reader unbounded gzip expansion causes memory exhaustion
CVE-2026-599332026-07-287.5PhpSpreadsheet: XLS/OLE sector-chain self-loop causes memory exhaustion
CVE-2026-599312026-07-287.7PhpSpreadsheet: SSRF bypass via HTTP redirect in WEBSERVICE() domain whitelist
CVE-2026-450342026-06-229.2PhpSpreadsheet: File::prohibitWrappers bypass

Add it to your agent

One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.

claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp

Then ask for triage_cve CVE-2019-12331, or call /api/v1/vulnerabilities/CVE-2019-12331. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.

NVD · CVE.org