CVE-2021-21237: Arbitrary code execution on Windows in github.com/git-lfs/git-lfs

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

The package github.com/git-lfs/git-lfs is a Go package that provides Git Large File Storage (LFS) functionality. It is used for managing large files in Git repositories. Git LFS replaces large files with text pointers, improving performance and reducing repository size. However, a vulnerability in the package allows for arbitrary code execution on Windows systems when cloning or operating on untrusted Git repositories.

Vulnerability Detail

The vulnerability (CVE-2021-21237) arises due to the behavior of exec.LookPath in the standard library on Windows. This behavior can be exploited by malicious actors to execute arbitrary code. When interacting with untrusted Git repositories, various methods within the package may trigger this vulnerability. The impact of this vulnerability can be severe, as it allows an attacker to execute arbitrary code on the affected Windows system.

How To Fix

Minimum fixed version

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

There is no specific workaround mentioned for this vulnerability. It is crucial to update the package to the fixed version as soon as possible to mitigate the risk of arbitrary code execution.

Conclusion

The vulnerability (CVE-2021-21237) in the github.com/git-lfs/git-lfs package allows for arbitrary code execution on Windows systems when interacting with untrusted Git repositories. To mitigate this risk, it is crucial to update the package to version 1.5.1-0.20210113180018-fc664697ed2c or later. This fix ensures that the vulnerability is patched and the system is protected. For additional support and guidance, please contact DevNack.com.

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

Share this vulnerability

FAQ

The vulnerability allows for arbitrary code execution on Windows systems when interacting with untrusted Git repositories. This can lead to unauthorized access, data breaches, and potential system compromise.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, providing valuable insights without requiring access to the code or installation.

At the time of this report, there are no known public exploits for this vulnerability. However, it is essential to update the package to the fixed version to prevent any potential exploitation.

Yes, this vulnerability can be exploited remotely. An attacker can craft a malicious Git repository and trick a user into cloning or operating on it, leading to arbitrary code execution on the user's Windows system.

For further support on vulnerability remediation, you can reach out to info@devnack.com. They can provide guidance and assistance in addressing this vulnerability.

References

Related vulnerabilities

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

How To Fix

Minimum fixed version

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