Git LFS may execute arbitrary commands via crafted Git LFS configurationsGHSA-x72p-hmqp-46hw
Fix: git-lfs/git-lfs@1ecddd4GHSA-x72p-hmqp-46hw is a CWE-777 vulnerability in github.com/git-lfs/git-lfs. A fix is available for github.com/git-lfs/git-lfs — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
github.com/git-lfs/git-lfs🐹github.com/git-lfs/git-lfs/v3Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Impact
When fetching objects from a malicious repository, Git LFS may execute an arbitrary command or binary after failing to sufficiently restrict the set of configuration options defined in an .lfsconfig file in the repository.
Git LFS permits a limited set of configuration options to be defined in an .lfsconfig file at the root of a Git repository, but does not filter these options correctly if their keys contain certain additional components, which allows an attacker to mimic options that configure Git LFS to use a custom command to transfer objects. An attacker can then provide an arbitrary command which Git LFS will invoke when fetching objects.
Git LFS has resolved this issue by correctly restricting the configuration of custom object transfer commands to local Git configuration files.
Patches
This problem exists in all versions since 1.3.0 and is patched in v3.8.1. All users should upgrade to v3.8.1.
Workarounds
No single workaround exists other than to disable Git LFS entirely. As far as possible, users and administrators should avoid cloning repositories from untrusted sources.
For more information
If you have any questions or comments about this advisory:
- For general questions, start a discussion in the Git LFS discussion forum.
- For reports of additional vulnerabilities, please follow the Git LFS security reporting policy.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/git-lfs/git-lfs | ≥ 1.3.0 | No fix |
| 🐹Go | github.com/git-lfs/git-lfs/v3 | ≥ 3.0.0&&< 3.8.1 | 3.8.1go get github.com/git-lfs/git-lfs/v3@v3.8.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/git-lfs/git-lfs, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
A fix is available for GHSA-x72p-hmqp-46hw; check the affected-versions list above or the advisory for the patched release of github.com/git-lfs/git-lfs, then make sure no transitive dependency still pins the vulnerable range.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat Product Security rates this vulnerability as Important because successful exploitation can allow an attacker to execute arbitrary commands with the privileges of the local user. Although remote code execution is possible, it is not rated Critical because exploitation requires user interaction to clone or fetch…
Avoid interacting with untrusted repositories or remove the git-lfs package if large file storage support is not required. To remove the Git LFS package on Red Hat Enterprise Linux: # dnf remove git-lfs Caveats: Removing git-lfs disables tracking, downloading, and uploading large assets managed by Git LFS. If Git LFS is required in your environment, isolate Git operations on unverified repositories within an unprivileged container or sandbox with restricted filesystem and network access.Source: Red Hat security advisory for GHSA-x72p-hmqp-46hw (CC BY 4.0)
Frequently Asked Questions
Is GHSA-x72p-hmqp-46hw in your dependencies?
Find it across Go, including transitive dependencies.