CVE-2021-36753: Uncontrolled Search Path Element in sharkdp/bat
7.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.41864%
CWE
Published
8/25/2021
Updated
2/3/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
bat | rust | < 0.18.2 | 0.18.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from using Rust's std::process::Command::new with unvalidated paths. On Windows, this API searches the current working directory before system paths. The pre-patch code in both less.rs (retrieve_less_version) and output.rs (pager setup) directly passed paths to Command::new, making them vulnerable to DLL hijacking. The fix introduced grep_cli::resolve_binary to properly resolve paths, confirming these were the vulnerable points. The confidence is high as the patch directly modifies these functions and the commit message explicitly references this security fix.