CVE-2022-4510: Binwalk Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-3cm8-v4mc-gppg
CVSS 7.8
CWE-22
Published
Advisory Summary

CVE-2022-4510 is a HIGH (CVSS 7.8) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Binwalk libraries in the PyPI ecosystem. The issue involves path traversal in binwalk. Remediation is available in the latest vendor maintenance releases.

CVE-2022-4510 at a Glance

CVE Identifier CVE-2022-4510
GHSA Identifier GHSA-3cm8-v4mc-gppg
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Binwalk
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-4510

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.

binwalk fixed: Latest secure release
pip install binwalk>=Latest secure release
Verify Direct and Transitive Dependencies

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-2022-4510, 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 the patched release), 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-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 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

A path traversal vulnerability was identified in ReFirm Labs binwalk from version 2.1.2b through 2.3.3 inclusive. By crafting a malicious PFS filesystem file, an attacker can get binwalk's PFS extractor to extract files at arbitrary locations when binwalk is run in extraction mode (-e option). Remote code execution can be achieved by building a PFS filesystem that, upon extraction, would extract a malicious binwalk module into the folder .config/binwalk/plugins. This vulnerability is associated with program files src/binwalk/plugins/unpfs.py. This issue affects binwalk from 2.1.2b through and including 2.3.3.

CVE-2022-4510 Affected Binwalk Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
binwalk
PyPI
≥ 2.1.2b
≤ 2.3.3

References

Frequently Asked Questions

What is CVE-2022-4510?
CVE-2022-4510 is a security vulnerability in Binwalk involving Path traversal in binwalk under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Binwalk versions are affected?
Affected versions include releases prior to current release patches across affected packages: binwalk.
What version fixes CVE-2022-4510?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is binwalk affected?
Yes, binwalk is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2022-4510?
CVE-2022-4510 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-4510?
CVE-2022-4510 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check PyPI dependencies for CVE-2022-4510?
Run the dependency tree command: 'pip show binwalk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3cm8-v4mc-gppg",
  "modified" : "2025-12-20T02:33:01Z",
  "published" : "2023-01-26T21:30:20Z",
  "aliases" : [ "CVE-2022-4510" ],
  "summary" : "Path traversal in binwalk",
  "details" : "A path traversal vulnerability was identified in ReFirm Labs binwalk from version 2.1.2b through 2.3.3 inclusive. By crafting a malicious PFS filesystem file, an attacker can get binwalk's PFS extractor to extract files at arbitrary locations when binwalk is run in extraction mode (-e option). Remote code execution can be achieved by building a PFS filesystem that, upon extraction, would extract a malicious binwalk module into the folder .config/binwalk/plugins. This vulnerability is associated with program files src/binwalk/plugins/unpfs.py. This issue affects binwalk from 2.1.2b through and including 2.3.3.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "binwalk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.2b"
      }, {
        "last_affected" : "2.3.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-4510"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ReFirmLabs/binwalk/pull/617"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ReFirmLabs/binwalk"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/12/msg00022.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202309-07"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-31T20:53:49Z",
    "nvd_published_at" : "2023-01-26T21:18:00Z"
  }
}