CVE-2021-21237: Git LFS can execute a Git binary from the current directory on Windows
7.2
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.42213%
CWE
Published
2/15/2022
Updated
2/14/2023
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/git-lfs/git-lfs | go | < 2.13.2 | 2.13.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from using Go's os/exec.Command
without proper PATH sanitization on Windows. The commit diff shows systematic replacement of exec.Command
with a custom subprocess.ExecCommand
that performs safe PATH resolution. The affected functions were all modified in the security patch, directly calling exec.Command
with external command names (like 'git') without directory separators, making them susceptible to executing malicious binaries in the current working directory due to Go's PATH search behavior on Windows.