CVE-2021-4287: binwalk vulnerable to UNIX Symbolic Link (Symlink) Following
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.58658%
CWE
Published
12/27/2022
Updated
7/18/2023
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
binwalk | pip | < 2.3.3 | 2.3.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from two key issues in extractor.py: 1) The callback function processed extracted files/directories without sanitizing symlinks (added in patch via symlink_sanitizer). 2) add_pending function's pre-patch logic (line 190 in diff) allowed recursive processing without validating symlink targets. The patch added: a) symlink sanitization checks, b) --preserve-symlinks opt-out, c) privilege dropping. These functions directly handled archive extraction flow without security checks present in patched versions.