CVE-2021-4287: Binwalk Binwalk Vulnerable To UNIX Symbolic Vulnerability
MODERATECVE-2021-4287 is a MODERATE (CVSS 6.5) binwalk vulnerable to unix symbolic vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Binwalk libraries in the PyPI ecosystem. The issue involves binwalk vulnerable to unix symbolic link (symlink) following. Remediation is available by upgrading affected packages to version 2.3.3.
CVE-2021-4287 at a Glance
Security Impact
CVSS: 6.5
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:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-4287
To remediate this vulnerability, upgrade all affected Binwalk 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 binwalk>=2.3.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show binwalk
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-4287, inspect your installed packages using pip:
pip show binwalk
Analyze the terminal output to locate any version of Binwalk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.3), your application is affected.
Note: The pip show binwalk command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Binwalk, 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-2021-4287 Affected Binwalk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
binwalk
|
PyPI |
< 2.3.3
|
2.3.3
|
References
Frequently Asked Questions
What is CVE-2021-4287?
Which Binwalk versions are affected?
What version fixes CVE-2021-4287?
Is binwalk affected?
What is the CVSS score of CVE-2021-4287?
What CWE is associated with CVE-2021-4287?
How can I check PyPI dependencies for CVE-2021-4287?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8m3f-g62j-3vx8",
"modified" : "2023-01-19T00:59:08Z",
"published" : "2022-12-27T12:30:19Z",
"aliases" : [ "CVE-2021-4287" ],
"summary" : "binwalk vulnerable to UNIX Symbolic Link (Symlink) Following",
"details" : "A vulnerability, which was classified as problematic, was found in ReFirm Labs binwalk up to 2.3.2. Affected is an unknown function of the file src/binwalk/modules/extractor.py of the component Archive Extraction Handler. The manipulation leads to symlink following. It is possible to launch the attack remotely. Upgrading to version 2.3.3 can address this issue. The name of the patch is fa0c0bd59b8588814756942fe4cb5452e76c1dcd. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-216876.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "binwalk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.3.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-4287"
}, {
"type" : "WEB",
"url" : "https://github.com/ReFirmLabs/binwalk/pull/556"
}, {
"type" : "WEB",
"url" : "https://github.com/ReFirmLabs/binwalk/commit/fa0c0bd59b8588814756942fe4cb5452e76c1dcd"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ReFirmLabs/binwalk"
}, {
"type" : "WEB",
"url" : "https://github.com/ReFirmLabs/binwalk/releases/tag/v2.3.3"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.216876"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.216876"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-59", "CWE-61" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-30T17:48:02Z",
"nvd_published_at" : "2022-12-27T11:15:00Z"
}
}