CVE-2018-19277: Phpoffice/phpspreadsheet Security Vulnerability Vulnerability
HIGHCVE-2018-19277 is a HIGH (CVSS 8.8) security vulnerability vulnerability (CWE-91: XML Injection (aka Blind XPath Injection)) affecting Phpoffice/phpspreadsheet libraries in the Packagist ecosystem. The issue involves xxe in phpspreadsheet due to encoding issue. Remediation is available by upgrading affected packages to version 1.5.1, 1.8.2.
CVE-2018-19277 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2018-19277
To remediate this vulnerability, upgrade all affected Phpoffice/phpspreadsheet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade phpoffice/phpspreadsheet to 1.5.1
Upgrade phpoffice/phpexcel to 1.8.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for phpoffice/phpspreadsheet
How to Check if You Are Affected
To determine whether your application is affected by CVE-2018-19277, inspect your project dependencies for Phpoffice/phpspreadsheet:
inspect dependencies for phpoffice/phpspreadsheet
Analyze the terminal output to locate any version of Phpoffice/phpspreadsheet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-91: XML Injection (aka Blind XPath Injection), where the product does not properly neutralize special elements that are used in xml, allowing attackers to modify the syntax, content, or commands of the xml before it is processed by an end system. In Phpoffice/phpspreadsheet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2018-19277 Affected Phpoffice/phpspreadsheet Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpoffice/phpspreadsheet
|
Packagist |
< 1.5.1
|
1.5.1
|
|
phpoffice/phpexcel
|
Packagist |
< 1.8.2
|
1.8.2
|
References
Frequently Asked Questions
What is CVE-2018-19277?
Which Phpoffice/phpspreadsheet versions are affected?
What version fixes CVE-2018-19277?
Is phpoffice/phpspreadsheet affected?
Is phpoffice/phpexcel affected?
What is the CVSS score of CVE-2018-19277?
What CWE is associated with CVE-2018-19277?
How can I check Packagist dependencies for CVE-2018-19277?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xcrg-29h7-h4cj",
"modified" : "2025-03-06T18:08:03Z",
"published" : "2019-11-20T01:38:52Z",
"aliases" : [ "CVE-2018-19277" ],
"summary" : "XXE in PHPSpreadsheet due to encoding issue",
"details" : "securityScan() in PHPOffice PhpSpreadsheet through 1.5.0 allows a bypass of protection mechanisms for XXE via UTF-7 encoding in a .xlsx file",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpoffice/phpspreadsheet"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpoffice/phpexcel"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.8.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-19277"
}, {
"type" : "WEB",
"url" : "https://github.com/MewesK/TwigSpreadsheetBundle/issues/18"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPOffice/PhpSpreadsheet/issues/771"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPOffice/PhpSpreadsheet/pull/780"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPOffice/PHPExcel/commit/2b601574975acfb9d4378a788ed5f2b747958095"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPOffice/PhpSpreadsheet/commit/0f8f071e24ee8b114d894ac172f77dc250e5bfa4"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/phpoffice/phpspreadsheet/CVE-2018-19277.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPOffice/PHPExcel/commits/1.8.2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PHPOffice/PhpSpreadsheet"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPOffice/PhpSpreadsheet/releases/tag/1.5.1"
}, {
"type" : "WEB",
"url" : "https://www.bishopfox.com/news/2018/11/phpoffice-versions"
}, {
"type" : "WEB",
"url" : "https://www.drupal.org/sa-contrib-2021-043"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-91" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2019-11-19T03:40:52Z",
"nvd_published_at" : "2018-11-14T11:29:00Z"
}
}