CVE-2022-4510 Path Traversal in binwalk

High 7.8 Published Updated

Attackers can achieve remote code execution by crafting malicious PFS files that exploit path traversal in binwalk's extraction mode.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-4510?

CVE-2022-4510 is a high-severity path traversal vulnerability in Refirm Labs binwalk, published on 25 Jan 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

A path traversal vulnerability was identified in ReFirm Labs binwalk from version 2.1.2b through 2.3.3 included. 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 2.3.3 included.

Weakness: CWE-22

Which versions are affected by CVE-2022-4510?

3 open source packages ship an affected version, including binwalk. It affects 1 product.

PackageAffectedFixed in
binwalk PyPIFrom 2.1.2b to 2.3.3None
binwalk PyPIFrom 2.1.2b to 2.3.3None
binwalk PyPIFrom 2.1.2b2.3.4
Linux distribution packages (1)
binwalk openSUSE:TumbleweedAll versions2.3.3-2.1

Products include Microsoft Binwalk.

How do I fix CVE-2022-4510?

Upgrade binwalk to 2.3.4 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2022-4510 being exploited?

There is no known exploitation of CVE-2022-4510 in the wild and no public exploit code.

Public exploit code: 1 Exploit-DB entry and 3 proofs of concept on GitHub.

Sources

Also known as DEBIAN-CVE-2022-4510, DLA-3339-1, DLA-4410-1, GHSA-3cm8-v4mc-gppg, MGASA-2023-0074, PYSEC-2026-787 and 2 more.

Is CVE-2022-4510 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free