CVE-2026-105803: Arbitrary Command Execution via .lfsconfig Parsing in Git LFS
Vulnerability ID: CVE-2026-105803
CVSS Score: 8.6
Published: 2026-11-20
CVE-2026-105803 (GHSA-x72p-hmqp-46hw) is a high-severity arbitrary command execution vulnerability in Git Large File Storage (Git LFS) affecting versions from v1.3.0 prior to v3.8.1. The flaw stems from the combination of an unanchored regular expression in custom transfer adapter initialization (CWE-777) and insufficient syntactic validation during .lfsconfig key filtering (CWE-1286). An attacker can craft a repository containing a malicious .lfsconfig file that bypasses safe-key filtering restrictions and registers an arbitrary binary as a custom transfer adapter, leading to remote code execution when a victim clones or fetches from the repository.
TL;DR
Git LFS versions 1.3.0 through 3.8.0 fail to properly restrict configuration keys loaded from untrusted in-repository .lfsconfig files. Due to token-count validation flaws in config/git_fetcher.go and an unanchored regular expression in tq/custom.go, attackers can inject custom transfer adapter paths disguised as remote or access configuration keys. Cloning or fetching an affected repository executes attacker-controlled binaries on the client system. Upgrading to Git LFS v3.8.1 resolves the issue.
⚠️ Exploit Status: POC
Technical Details
- CVE / Advisory ID: CVE-2026-105803 / GHSA-x72p-hmqp-46hw
- Weakness Class: CWE-777 (Unanchored Regex) & CWE-1286 (Improper Syntactic Validation)
- CVSS v4.0 Score: 8.6 High (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N)
- EPSS Score: 0.00545 (46.61st Percentile)
- Attack Vector: Network (Cloning or fetching an untrusted Git repository with a crafted .lfsconfig)
- Impact: Arbitrary Command Execution / Remote Code Execution
- Exploit Status: PoC available in official regression test suite (t/t-custom-transfers-protect.sh)
- CISA KEV Status: Not Listed
Affected Systems
- Git LFS (git-lfs/git-lfs)
- Git for Windows (bundled git-lfs.exe)
-
Git LFS: >= 1.3.0, <= 2.13.3 (Fixed in:
3.8.1) -
Git LFS: >= 3.0.0, < 3.8.1 (Fixed in:
3.8.1) -
Git for Windows: < 2.56.0.windows.3 (Fixed in:
2.56.0.windows.3)
Code Analysis
Commit: 62a727e
Anchor custom transfer path configuration key regular expression with \A and \z in tq/custom.go
--- a/tq/custom.go
+++ b/tq/custom.go
@@ -364,7 +364,8 @@ func configureDefaultCustomAdapters(git Env, m *concreteManifest) {
func configureCustomAdapters(git Env, m *concreteManifest) {
configureDefaultCustomAdapters(git, m)
- pathRegex := regexp.MustCompile(`lfs\.((?i)customtransfer\.([^.]+))\.path`)
+ pathRegex := regexp.MustCompile(`\Alfs\.((?i)customtransfer\.([^.]+))\.path\z`)
+
for k, _ := range git.All() {
match := pathRegex.FindStringSubmatch(k)
if match == nil {
Commit: 5182fde
Enforce strict token count and trailing lfsurl check for remote.* keys in config/git_fetcher.go
--- a/config/git_fetcher.go
+++ b/config/git_fetcher.go
@@ -80,7 +80,7 @@ func readGitConfig(configs ...*git.ConfigurationSource) (gf *GitFetcher, extensi
extensions[name] = ext
} else if len(parts) > 1 && parts[0] == "remote" {
- if gc.OnlySafeKeys && (len(parts) == 3 && parts[2] != "lfsurl") {
+ if gc.OnlySafeKeys && (len(parts) < 3 || parts[len(parts)-1] != "lfsurl") {
ignored = append(ignored, key)
continue
}
Commit: 1ecddd4
Require access configuration keys in .lfsconfig to begin with the lfs prefix token in config/git_fetcher.go
--- a/config/git_fetcher.go
+++ b/config/git_fetcher.go
@@ -88,7 +88,7 @@ func readGitConfig(configs ...*git.ConfigurationSource) (gf *GitFetcher, extensi
allowed = true
remote := strings.Join(parts[1:len(parts)-1], ".")
uniqRemotes[remote] = remote == "origin"
- } else if len(parts) > 2 && parts[len(parts)-1] == "access" {
+ } else if len(parts) > 2 && parts[0] == "lfs" && parts[len(parts)-1] == "access" {
allowed = true
}
Commit: c5b3bff
Associated commit for anchoring custom transfer path regular expression
Commit: dcfb09f
Associated commit for strict remote configuration key filtering
Commit: 45c0c51
Associated commit for strict access configuration key filtering
Exploit Details
- GitHub (Official Regression Tests in Fix Commit): Regression tests in t/t-custom-transfers-protect.sh demonstrating custom transfer adapter injection via .lfsconfig using .access and remote.*.lfsurl keys.
Mitigation Strategies
- Upgrade Git LFS binaries across all developer workstations, build servers, and container images to v3.8.1 or newer.
- Update bundled Git distributions, specifically upgrading Git for Windows to v2.56.0.windows.3 or later.
- Disable automatic Git LFS smudge and filter-process execution when cloning untrusted third-party repositories until
.lfsconfighas been inspected. - Audit repository
.lfsconfigfiles in CI/CD pipelines before executinggit lfs fetchorgit lfs pull.
Remediation Steps:
- Verify the currently installed Git LFS version by running
git lfs version. - Download and install Git LFS v3.8.1 (or upgrade via system package managers / Homebrew / Git for Windows v2.56.0.windows.3+).
- Re-run
git lfs installif necessary to ensure updated binary paths are registered in the environment. - If patching cannot be performed immediately, enforce
git config --global filter.lfs.process ""andgit config --global filter.lfs.smudge ""on systems handling untrusted repositories, and audit.lfsconfigmanually before fetching LFS objects.
References
- GitHub Security Advisory GHSA-x72p-hmqp-46hw
- Git LFS Release v3.8.1
- Official CVE Record (CVE.org)
- NVD Vulnerability Detail: CVE-2026-105803
- Fix Commit: Anchored Regex for Custom Adapters (62a727e)
- Fix Commit: Strict Remote Config Parsing (5182fde)
- Fix Commit: Strict Access Config Parsing (1ecddd4)
- Associated Fix Commit (45c0c51)
- Associated Fix Commit (c5b3bff)
- Associated Fix Commit (dcfb09f)
- CVE List v5 JSON Record
Read the full report for CVE-2026-105803 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)