
Proof-of-concept and differential lab for CVE-2026-105803: a crafted .lfsconfig key bypasses Git LFS safe-key filtering and an unanchored regex to register an attacker-chosen transfer binary.
| CVE | CVE-2026-105803 |
| Component | Git LFS — tq/custom.go (configureCustomAdapters), config/git_fetcher.go (readGitConfig) |
| Affected | 1.3.0 through 3.8.0 |
| Fixed in | 3.8.1 — commits 62a727e7/c5b3bff4 (anchored regex), 1ecddd43/45c0c51c (access keys), 5182fde/dcfb09ff (remote keys); GHSA-x72p-hmqp-46hw |
| CWE | CWE-777 (Regular Expression without Anchors), CWE-1286 (Improper Validation of Syntactic Correctness of Input) |
| Impact | A malicious repository's .lfsconfig carries a crafted key that passes the safe-key filter and mimics a custom-transfer option, causing Git LFS to register and execute an attacker-selected command/binary while fetching objects |
| Vector | Repository-controlled configuration — cloning/fetching from a hostile repo |
| Trigger | .lfsconfig key lfs.customtransfer.evil.path.access = /tmp/evil-transfer |
The vulnerable custom-transfer matcher used an unanchored regular expression:
// v3.8.0, tq/custom.go configureCustomAdapters()
pathRegex := regexp.MustCompile(`lfs\.((?i)customtransfer\.([^.]+))\.path`)
The fix anchors it to the complete key:
// v3.8.1
pathRegex := regexp.MustCompile(`\Alfs\.((?i)customtransfer\.([^.]+))\.path\z`)
Two defects chain into command execution from a repository-controlled
.lfsconfig:
.lfsconfig is parsed with
onlySafeKeys=true; keys ending in .access are treated as LFS access
configs. The pre-fix matcher accepted any *.access key, and even the
tightened matcher accepts lfs.customtransfer.evil.path.access because
it starts with lfs and ends with access. The crafted key therefore
survives the filter on both versions.configureCustomAdapters scans every config key
with lfs\.customtransfer\.([^.]+)\.path — no anchors. The substring
lfs.customtransfer.evil.path embedded inside the .access-suffixed
key matches, so the adapter named evil is registered with the
attacker-supplied value as its executable path. Git LFS runs that
binary as a custom transfer agent when fetching objects.The fix anchors the regex (\A...\z), so only a complete, exact
lfs.customtransfer.<name>.path key registers an adapter; the companion
commits tighten access/remote key matching in readGitConfig.
| service | image | role |
|---|---|---|
lfs3-vuln | cve-2026-105803:vuln | Git LFS v3.8.0 |
lfs3-fixed | cve-2026-105803:fixed | Git LFS v3.8.1 (vendor fix) |
poc | cve-2026-105803-poc:local | stdlib-only Python driver |
In-package Go test binaries call the real upstream code from each tag:
config.readGitConfig (safe-key filter, /keys) and the tq
manifest/adapter setup (configureCustomAdapters, /transfer). Both sides
differ only in the Git LFS version.
./run-lab.sh build # builds both tags with Go 1.25
./run-lab.sh up # cve105803lab network: lfs3-vuln / lfs3-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
evil transfer
adapter, 0 when rejected; 3 no worker, 2 unreachable.*.access filter check.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=lfs3-vuln
# exit 1 on confirmed adapter registration, 0 on a safe target
| key shape | lfs3-vuln (3.8.0) | lfs3-fixed (3.8.1) |
|---|---|---|
lfs.customtransfer.evil.path (exact, legit) | adapter evil | adapter evil |
lfs.customtransfer.evil.path.access | adapter evil → /tmp/evil-transfer | no adapter |
extra.lfs.customtransfer.evil.path.access | adapter evil | no adapter |
remote.lfs.customtransfer.evil.path | adapter evil | no adapter |
other.example.access safe-filter acceptance | accepted | rejected |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve105803lab
network..lfsconfig carries the crafted key; the registered
binary executes during object transfer.The fixed line rejects every crafted key shape (access suffix, extra
prefix, remote prefix) — only the exact legitimate key registers an
adapter. The anchored regex closes the substring-match bypass, and
non-LFS *.access keys are rejected by the tightened safe-key filter.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/lab.Dockerfile builds both upstream tags
lab/harness/ in-package Go harnesses (config + tq), per-tag API
lab/service.py HTTP wrapper (POST /keys, POST /transfer)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)