Vulnerabilities in pkg:pypi/openpyxl
PACKAGECVE-2017-5992 is a MODERATE (CVSS 8.2) improper restriction of xml external vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Openpyxl libraries in the PyPI ecosystem. The issue involves improper restriction of xml external entity reference in openpyxl. Remediation is available by upgrading affected packages to version 2.4.2.
pkg:pypi/openpyxl
Vulnerability advisories affecting package pkg:pypi/openpyxl. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-chqf-hx79-gxc6 | CVE-2017-5992 | MODERATE | Improper Restriction of XML External Entity Reference in Openpyxl |
CVE-2017-5992 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:H).
How to Fix CVE-2017-5992
To remediate this vulnerability, upgrade all affected Openpyxl dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install openpyxl>=2.4.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show openpyxl
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2017-5992, inspect your installed packages using pip:
pip show openpyxl
Analyze the terminal output to locate any version of Openpyxl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.2), your application is affected.
Note: The pip show openpyxl command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Openpyxl, 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-2017-5992 Affected Openpyxl Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
openpyxl
|
PyPI |
< 2.4.2
|
2.4.2
|
References
Frequently Asked Questions
What is CVE-2017-5992?
Which Openpyxl versions are affected?
What version fixes CVE-2017-5992?
Is openpyxl affected?
What is the CVSS score of CVE-2017-5992?
What CWE is associated with CVE-2017-5992?
How can I check PyPI dependencies for CVE-2017-5992?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-chqf-hx79-gxc6",
"modified" : "2024-10-07T21:29:00Z",
"published" : "2022-05-17T02:58:54Z",
"aliases" : [ "CVE-2017-5992" ],
"summary" : "Improper Restriction of XML External Entity Reference in Openpyxl",
"details" : "Openpyxl 2.4.1 resolves external entities by default, which allows remote attackers to conduct XXE attacks via a crafted .xlsx document.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:N/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "openpyxl"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.4.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.4.1"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-5992"
}, {
"type" : "WEB",
"url" : "https://bitbucket.org/openpyxl/openpyxl/commits/3b4905f428e1"
}, {
"type" : "WEB",
"url" : "https://bitbucket.org/openpyxl/openpyxl/issues/749"
}, {
"type" : "WEB",
"url" : "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854442"
}, {
"type" : "PACKAGE",
"url" : "https://foss.heptapod.net/openpyxl/openpyxl"
}, {
"type" : "WEB",
"url" : "https://foss.heptapod.net/openpyxl/openpyxl/-/commit/7fe678fd89fd"
}, {
"type" : "WEB",
"url" : "https://foss.heptapod.net/openpyxl/openpyxl/-/issues/749"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-chqf-hx79-gxc6"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/openpyxl/PYSEC-2017-48.yaml"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2017/02/07/5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-611" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-01T11:49:57Z",
"nvd_published_at" : "2017-02-15T19:59:00Z"
}
}