CVE-2021-21237: Git LFS Windows Arbitrary Code Execution

github.com/git-lfs/git-lfs Updated 02 Oct 2025

Summary

14/04/2021
Yes i
High
7.2

CVE-2021-21237: Arbitrary code execution on Windows in github.com/git-lfs/git-lfs. Affects github.com/git-lfs/git-lfs versions < 1.5.1-0.20210113180018-fc664697ed2c. Fixed in 1.5.1-0.20210113180018-fc664697ed2c. How to fix ↓

Also tracked for

The same CVE-2021-21237 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Git LFS is a Git extension that allows the versioning of large files. It is written in Go and is primarily used for managing binary files in Git repositories. Git LFS operates on both Unix and Windows systems. However, on Windows, there is a vulnerability that allows the execution of a Git binary from the current directory. This vulnerability does not affect Unix systems. The issue arises due to an incomplete fix for a previous vulnerability (CVE-2020-27955).

Vulnerability Detail

On Windows, if Git LFS interacts with a malicious repository containing a git.bat or git.exe file in the current directory, the program will be executed, enabling the attacker to run arbitrary code. This can lead to unauthorized access, data manipulation, or system compromise. The vulnerability stems from Go's behavior on Windows, where it includes and prefers the current directory when the name of a command does not contain a directory separator. The severity of this vulnerability is rated as HIGH with a CVSS score of 7.2.

How To Fix

Latest published version: v2.5.2+incompatible as of 23 Oct 2026

go get github.com/git-lfs/git-lfs@v2.5.2+incompatible

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.1-0.20210113180018-fc664697ed2c

This is the first release that contains the fix.

go get github.com/git-lfs/git-lfs@v1.5.1-0.20210113180018-fc664697ed2c

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

Unfortunately, there are no effective workarounds for this vulnerability other than avoiding untrusted repositories or using a different operating system. It is crucial to exercise caution when interacting with Git repositories and only use trusted sources.

Conclusion

The vulnerability in Git LFS on Windows systems allows the execution of arbitrary code, posing a significant security risk. It is crucial to update Git LFS to version 2.13.2 or later to mitigate this vulnerability. Users should exercise caution when interacting with Git repositories and only use trusted sources. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/git-lfs/git-lfs →

Share this vulnerability

FAQ

Git LFS (Large File Storage) is a Git extension that allows the versioning of large files in Git repositories. It is primarily used for managing binary files.

This vulnerability affects Git LFS installations on Windows systems. Unix systems are not impacted.

The vulnerability allows the execution of arbitrary code, which can lead to unauthorized access, data manipulation, or system compromise.

Yes, the vulnerability has been patched in Git LFS version 2.13.2. It is recommended to update to this version or later to mitigate the risk.

Unfortunately, there are no effective workarounds for this vulnerability other than avoiding untrusted repositories or using a different operating system.

References

Related vulnerabilities

Recent vulnerabilities recorded for github.com/git-lfs/git-lfs.

How To Fix

Latest published version: v2.5.2+incompatible as of 23 Oct 2026

go get github.com/git-lfs/git-lfs@v2.5.2+incompatible

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.1-0.20210113180018-fc664697ed2c

This is the first release that contains the fix.

go get github.com/git-lfs/git-lfs@v1.5.1-0.20210113180018-fc664697ed2c

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback