CVE-2018-19277: Phpoffice/phpspreadsheet Security Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-xcrg-29h7-h4cj
CVSS 8.8
CWE-91
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2018-19277
GHSA Identifier GHSA-xcrg-29h7-h4cj
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-91: XML Injection (aka Blind XPath Injection)
Affected Product Phpoffice/phpspreadsheet
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

phpoffice/phpspreadsheet fixed: 1.5.1
Upgrade phpoffice/phpspreadsheet to 1.5.1
phpoffice/phpexcel fixed: 1.8.2
Upgrade phpoffice/phpexcel to 1.8.2
Verify Direct and Transitive Dependencies

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

securityScan() in PHPOffice PhpSpreadsheet through 1.5.0 allows a bypass of protection mechanisms for XXE via UTF-7 encoding in a .xlsx file

CVE-2018-19277 Affected Phpoffice/phpspreadsheet Versions

2 component(s)
Fixed Versions:
1.5.11.8.2
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?
CVE-2018-19277 is a security vulnerability in Phpoffice/phpspreadsheet involving XXE in PHPSpreadsheet due to encoding issue under CWE-91: XML Injection (aka Blind XPath Injection).
Which Phpoffice/phpspreadsheet versions are affected?
Affected versions include releases prior to 1.5.1, 1.8.2 across affected packages: phpoffice/phpspreadsheet, phpoffice/phpexcel.
What version fixes CVE-2018-19277?
Upgrading to 1.5.1, 1.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is phpoffice/phpspreadsheet affected?
Yes, phpoffice/phpspreadsheet is affected in releases prior to 1.5.1. Upgrade your dependency to 1.5.1 or later.
Is phpoffice/phpexcel affected?
Yes, phpoffice/phpexcel is affected in releases prior to 1.8.2. Upgrade your dependency to 1.8.2 or later.
What is the CVSS score of CVE-2018-19277?
CVE-2018-19277 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-19277?
CVE-2018-19277 is classified under CWE-91: XML Injection (aka Blind XPath Injection) (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.).
How can I check Packagist dependencies for CVE-2018-19277?
Run the dependency tree command: 'inspect dependencies for phpoffice/phpspreadsheet'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}