CVE-2021-21237
Git LFS can execute a Git binary from the current directory on Windows
Also known as BIT-git-lfs-2021-21237, GHSA-cx3w-xqmc-84g5, GO-2021-0098
Mitigation
- Upgrade github.com/git-lfs/git-lfs to one of 2.13.2, 1.5.1-0.20210113180018-fc664697ed2c (or later in the same release line).
Who should check
- Projects that depend on Go package github.com/git-lfs/git-lfs (< 2.13.2)
- Anyone running git-lfs < 2.13.2
Vulnerability facts
- Affected
- github.com/git-lfs/git-lfs < 2.13.2
- Fixed in
- 2.13.2, 1.5.1-0.20210113180018-fc664697ed2c
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.2 (v3.1, CNA)CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: High
- Privileges required: Low
- User interaction: Required
- Scope: Changed (impact reaches other components)
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: None
- EPSS
- 0.45% chance of exploitation in 30 days (percentile 31, 2026-11-26)
- CWE
- CWE-426
- Modified
Description
Git LFS is a command line extension for managing large files with Git. On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. This is the result of an incomplete fix for CVE-2020-27955. This issue occurs because on Windows, Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator. Other than avoiding untrusted repositories or using a different operating system, there is no workaround. This is fixed in v2.13.2.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go github.com/git-lfs/git-lfs | < 2.13.2 | 2.13.2, 1.5.1-0.20210113180018-fc664697ed2c | osv |
| git-lfs | < 2.13.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-21237. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-21237.md Affected: github.com/git-lfs/git-lfs < 2.13.2 Fixed in: 2.13.2, 1.5.1-0.20210113180018-fc664697ed2c Steps: 1. Search this machine and project for github.com/git-lfs/git-lfs (Go), git-lfs: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2021-21237 being exploited?
There is no confirmed exploitation: CVE-2021-21237 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.45% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-21237?
High: CVSS 7.2 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2021-21237?
github.com/git-lfs/git-lfs < 2.13.2.
Is there a fix for CVE-2021-21237?
Yes. Fixed in 2.13.2, 1.5.1-0.20210113180018-fc664697ed2c. Upgrade github.com/git-lfs/git-lfs to one of 2.13.2, 1.5.1-0.20210113180018-fc664697ed2c (or later in the same release line).
How do I check if I'm affected by CVE-2021-21237?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.