CVE-2017-5992: Openpyxl XXE Vulnerability

openpyxl Updated 02 Oct 2025

Summary

15/02/2017
Yes i
Moderate
8.2

CVE-2017-5992: Openpyxl 2.4.1 resolves external entities by default, which allows remote attackers to conduct XXE attacks via a crafted .xlsx document. Affects openpyxl versions < 2.4.1. Fixed in 2.4.1. How to fix ↓

Also tracked for

The same CVE-2017-5992 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

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

Openpyxl is a Python library for reading and writing Excel files. It provides functionality to create, modify, and extract data from Excel spreadsheets. The library is widely used in various Python projects and applications. However, Openpyxl versions prior to 2.4.1 are vulnerable to an XML External Entity (XXE) attack. This vulnerability allows remote attackers to exploit external entities in crafted .xlsx documents, potentially leading to unauthorized information disclosure or denial of service.

Vulnerability Detail

The vulnerability (CVE-2017-5992) in Openpyxl arises from the library's default behavior of resolving external entities. By default, Openpyxl versions prior to 2.4.1 do not properly validate and sanitize input from .xlsx files, allowing an attacker to include malicious XML entities. This can lead to various attacks, including XML eXternal Entity (XXE) attacks. An attacker can craft a specially crafted .xlsx document that, when processed by an application using Openpyxl, triggers the parsing of external entities. This can result in the disclosure of sensitive information, denial of service, or other malicious activities.

How To Fix

Latest published version: 3.1.5 as of 23 Oct 2026

pip install --upgrade "openpyxl==3.1.5"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.4.1

This is the first release that contains the fix.

pip install --upgrade "openpyxl==2.4.1"

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

Conclusion

The Openpyxl XXE vulnerability (CVE-2017-5992) poses a risk to applications using Openpyxl versions prior to 2.4.1. It is crucial to upgrade to the latest version of Openpyxl to mitigate the vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for openpyxl →

Share this vulnerability

FAQ

Openpyxl is a Python library for reading and writing Excel files. It provides functionality to create, modify, and extract data from Excel spreadsheets.

An XML External Entity (XXE) attack is a type of attack that exploits vulnerabilities in XML parsers. By including malicious XML entities, an attacker can manipulate the parsing process to disclose sensitive information, perform denial of service attacks, or execute arbitrary code.

The Openpyxl XXE vulnerability allows remote attackers to exploit external entities in crafted .xlsx documents. This can lead to unauthorized information disclosure, denial of service, or other malicious activities depending on how the application processes the malicious input.

Currently, there is no known workaround for the Openpyxl XXE vulnerability. It is recommended to upgrade to Openpyxl version 2.4.1 or later to mitigate the risk.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by the Openpyxl XXE vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just the Pipfile.lock file of your application.

Related vulnerabilities

Recent vulnerabilities recorded for openpyxl.

How To Fix

Latest published version: 3.1.5 as of 23 Oct 2026

pip install --upgrade "openpyxl==3.1.5"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.4.1

This is the first release that contains the fix.

pip install --upgrade "openpyxl==2.4.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