CVE-2022-44900: Py7zr Path Traversal Vulnerability
CRITICALCVE-2022-44900 is a CRITICAL (CVSS 9.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Py7zr libraries in the PyPI ecosystem. The issue involves py7zr directory traversal vulnerability. Remediation is available by upgrading affected packages to version 0.20.1.
CVE-2022-44900 at a Glance
Security Impact
CVSS: 9.1
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:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2022-44900
To remediate this vulnerability, upgrade all affected Py7zr 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 py7zr>=0.20.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show py7zr
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-44900, inspect your installed packages using pip:
pip show py7zr
Analyze the terminal output to locate any version of Py7zr in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.20.1), your application is affected.
Note: The pip show py7zr command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Py7zr, 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-2022-44900 Affected Py7zr Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
py7zr
|
PyPI |
< 0.20.1
|
0.20.1
|
References
Frequently Asked Questions
What is CVE-2022-44900?
Which Py7zr versions are affected?
What version fixes CVE-2022-44900?
Is py7zr affected?
What is the CVSS score of CVE-2022-44900?
What CWE is associated with CVE-2022-44900?
How can I check PyPI dependencies for CVE-2022-44900?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m8xw-9x5x-6vh3",
"modified" : "2024-10-18T22:00:27Z",
"published" : "2022-12-06T21:30:45Z",
"aliases" : [ "CVE-2022-44900" ],
"summary" : "py7zr directory traversal vulnerability",
"details" : "A directory traversal vulnerability in the SevenZipFile.extractall() function of the python library py7zr v0.20.0 and earlier allows attackers to write arbitrary files via extracting a crafted 7z file.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "py7zr"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.20.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.20.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-44900"
}, {
"type" : "WEB",
"url" : "https://github.com/miurahr/py7zr/commit/1bb43f17515c7f69673a1c88ab9cc72a7bbef406"
}, {
"type" : "WEB",
"url" : "https://advisory-inbox.githubapp.com/advisory_reviews/GHSA-m8xw-9x5x-6vh3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/miurahr/py7zr"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/py7zr/PYSEC-2022-42998.yaml"
}, {
"type" : "WEB",
"url" : "https://lessonsec.com/cve/cve-2022-44900"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/170127/py7zr-0.20.0-Directory-Traversal.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-06T22:34:58Z",
"nvd_published_at" : "2022-12-06T20:15:00Z"
}
}