.. / CVE-2022-4510

Exploit for binwalk 2.1.2b-2.3.3 - Path Traversal to Remote Code Execution (CVE-2022-4510)

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.

Proof of Concept

PoC exploit

Try the exploit in a lab environment:

Lab Machine Link
Hack The Box Pilgrimage Go to Practice

References:

https://nvd.nist.gov/vuln/detail/CVE-2022-4510
https://github.com/ReFirmLabs/binwalk/pull/617
https://security.gentoo.org/glsa/202309-07