malicious repositories can execute remote code while cloning
A crafted repository with symbolic links and files using clean/smudge filters like Git LFS can cause a script to be executed during cloning on case-insensitive file systems. An attacker could execute arbitrary code on a victim's machine by tricking them into cloning a malicious repository.
github.com
Published on github.com
A specially crafted repository that contains symbolic links as well as files using a clean/smudge filter such as Git LFS, may cause just-checked out script to be executed while cloning onto a case-insensitive file system such as NTFS, HFS+ or APFS (i.e. the default file systems on Windows and macOS).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a case-insensitive file system allows a symbolic link to overwrite a file that is later processed by a clean/smudge filter, leading to execution of attacker-controlled content.
Impact
An attacker could execute arbitrary code on a victim's machine if the victim clones a malicious repository on a case-insensitive file system with clean/smudge filters configured (e.g., Git LFS on Git for Windows).
What the attacker needed
Case-insensitive file system (NTFS, HFS+, APFS); clean/smudge filter configured (e.g., Git LFS); clone a malicious repository
The fix
The problem was fixed in versions published on 9 March 2021; users should update to those versions.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you clone a Git repository, Git checks out files onto your disk. On Windows and macOS, the file system ignores case (so 'File.txt' and 'file.txt' are the same). A malicious repository can use symbolic links (shortcuts to other files) and filters (programs that process files during checkout) to make Git run a script you didn't intend to run. This could let an attacker run code on your computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.