CVE-2018-19277: XXE in PHPSpreadsheet due to encoding issue

phpoffice/phpspreadsheet Updated 02 Oct 2025

Summary

20/11/2019
Yes i
High
8.8

CVE-2018-19277: XXE in PHPSpreadsheet due to encoding issue. Affects phpoffice/phpspreadsheet versions < 1.5.1. Fixed in 1.5.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

PHPSpreadsheet is a popular PHP library used for reading and writing spreadsheet files. It provides a wide range of functionality for manipulating Excel files. However, versions up to 1.5.0 are vulnerable to an XML External Entity (XXE) attack due to an encoding issue. This vulnerability allows an attacker to bypass protection mechanisms and exploit the application by using UTF-7 encoding in a .xlsx file.

Vulnerability Detail

The securityScan() function in PHPOffice PhpSpreadsheet through version 1.5.0 is susceptible to an XXE attack. By utilizing UTF-7 encoding in a specially crafted .xlsx file, an attacker can bypass protection mechanisms and gain unauthorized access to sensitive information. This vulnerability has a high severity rating (CVSS score: 8.8) and can lead to data leakage, denial of service, or remote code execution.

How To Fix

Minimum fixed version

1.5.1

This is the first release that contains the fix.

composer require phpoffice/phpspreadsheet:1.5.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the package is not immediately feasible, a temporary workaround is to disable the processing of external entities in the affected application's XML parser. This can be achieved by modifying the XML parser settings to disallow the resolution of external entities. Here is an example of how to disable external entity resolution in PHP:

$disableEntities = libxml_disable_entity_loader(true);

This workaround should only be considered as a temporary solution until the package is updated.

Conclusion

The XXE vulnerability in PHPSpreadsheet poses a significant risk to applications utilizing this library. It is crucial to update the package to version 1.5.0 or later to mitigate the vulnerability. If immediate updating is not possible, consider applying the temporary workaround of disabling external entity resolution. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for phpoffice/phpspreadsheet →

Share this vulnerability

FAQ

PHPSpreadsheet is a PHP library that allows developers to read, write, and manipulate spreadsheet files, including Excel files. It provides a wide range of functionality for working with spreadsheet data.

An XML External Entity (XXE) attack is a type of security vulnerability that allows an attacker to exploit an XML parser's functionality to read arbitrary files or execute remote requests. In this case, the XXE attack is possible due to an encoding issue in PHPSpreadsheet.

This vulnerability can lead to unauthorized access to sensitive information, data leakage, denial of service, or even remote code execution. It is crucial to update the PHPSpreadsheet package to mitigate the risk.

To update the PHPSpreadsheet package, you can use Composer, a dependency management tool for PHP. Run the following command in your project's root directory: composer update phpoffice/phpspreadsheet

Yes, if updating the package is not immediately feasible, you can temporarily disable the processing of external entities in the XML parser. However, this should only be considered as a temporary solution until the package is updated.

Related vulnerabilities

Recent vulnerabilities recorded for phpoffice/phpspreadsheet.

How To Fix

Minimum fixed version

1.5.1

This is the first release that contains the fix.

composer require phpoffice/phpspreadsheet:1.5.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback