CVE-2018-14065: PHPOffice Common Improper Restriction of XML External Entity Reference

phpoffice/common Updated 02 Oct 2025

Summary

14/05/2022
Yes i
Critical
9.8

CVE-2018-14065: PHPOffice Common Improper Restriction of XML External Entity Reference. Affects phpoffice/common versions < 0.2.9. Fixed in 0.2.9. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

PHPOffice Common is a package available on Packagist that provides a set of common classes and methods used by various PHP Office projects. It is designed to simplify the development of PHP Office applications by providing a consistent and easy-to-use API. The package is widely used in the PHP community for creating and manipulating office documents. However, a vulnerability has been discovered in the XMLReader.php file of PHPOffice Common before version 0.2.9, which allows for XML External Entity (XXE) attacks.

Vulnerability Detail

The vulnerability (CVE-2018-14065) in PHPOffice Common arises from improper restriction of XML External Entity references in the XMLReader.php file. An attacker can exploit this vulnerability by crafting a specially crafted XML document that includes external entity references. When the vulnerable code parses the XML document, it resolves the external entity references, leading to potential information disclosure, server-side request forgery (SSRF), and denial of service (DoS) attacks. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

Minimum fixed version

0.2.9

This is the first release that contains the fix.

composer require phpoffice/common:0.2.9

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

Workaround

As a temporary workaround, developers can disable the use of external entities in the XMLReader.php file. This can be achieved by modifying the code to set the LIBXML_NOENT flag when creating the XMLReader object. Here is an example of how to implement this workaround:

$reader = new XMLReader();
$reader->open('file.xml', null, LIBXML_NOENT);

However, it is strongly recommended to apply the official fix by upgrading to the latest version of the PHPOffice Common package.

Conclusion

In conclusion, the PHPOffice Common package before version 0.2.9 is vulnerable to an improper restriction of XML External Entity references. This vulnerability can be exploited to perform XXE attacks, potentially leading to information disclosure, SSRF, and DoS attacks. It is crucial to upgrade to the latest version of the package and validate XML input to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for phpoffice/common →

Share this vulnerability

FAQ

PHPOffice Common is a package available on Packagist that provides a set of common classes and methods used by various PHP Office projects. It simplifies the development of PHP Office applications by offering a consistent and easy-to-use API.

The vulnerability (CVE-2018-14065) in PHPOffice Common is an improper restriction of XML External Entity references in the XMLReader.php file. It allows for XML External Entity (XXE) attacks.

The vulnerability can lead to information disclosure, server-side request forgery (SSRF), and denial of service (DoS) attacks.

The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

To fix this vulnerability, it is recommended to upgrade the PHPOffice Common package to version 0.2.9 or later. Additionally, developers should review and validate any XML input to ensure it does not contain malicious external entity references.

How To Fix

Minimum fixed version

0.2.9

This is the first release that contains the fix.

composer require phpoffice/common:0.2.9

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