CVE-2022-4510
Python vulnerability analysis and mitigation

Overview

A path traversal vulnerability (CVE-2022-4510) was identified in ReFirm Labs binwalk versions 2.1.2b through 2.3.3. The vulnerability was discovered in late 2022 and publicly disclosed in January 2023. The issue affects the PFS extractor component of binwalk, specifically in the src/binwalk/plugins/unpfs.py file (NVD).

Technical details

The vulnerability stems from improper path resolution in the PFS extractor script. When binwalk is run in extraction mode (-e option), an attacker can craft a malicious PFS filesystem file that allows for arbitrary file extraction locations. The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (HIGH) with the vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H. The issue is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) (NVD).

Impact

The vulnerability can lead to remote code execution. An attacker can build a PFS filesystem that, upon extraction, would place a malicious binwalk module into the .config/binwalk/plugins folder, which would then be loaded and executed by binwalk. This allows for arbitrary code execution in the context of the user running binwalk (GitHub PR).

Mitigation and workarounds

The vulnerability has been fixed in binwalk version 2.3.4. Users are advised to upgrade to this version or later. The fix involves properly resolving paths using os.path.abspath instead of relying on os.path.join (Gentoo Security, GitHub PR).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management