CVE-2021-21300

8.0 HIGH

📋 TL;DR

This vulnerability allows remote code execution when cloning malicious Git repositories on case-insensitive file systems (Windows/macOS default). Attackers can craft repositories with symbolic links and Git LFS filters to execute arbitrary code during checkout. Users of Git on Windows/macOS with Git LFS configured are primarily affected.

💻 Affected Systems

Products:
  • Git
  • Git for Windows
Versions: 2.14.2 through 2.30.0 (excluding patched versions)
Operating Systems: Windows, macOS
Default Config Vulnerable: ⚠️ Yes
Notes: Requires case-insensitive file system (NTFS/HFS+/APFS) AND clean/smudge filters like Git LFS configured. Git for Windows has Git LFS enabled by default.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise via arbitrary code execution with user privileges, potentially leading to data theft, ransomware deployment, or lateral movement.

🟠

Likely Case

Malicious repository clones execute payloads that steal credentials, install malware, or establish persistence on developer machines.

🟢

If Mitigated

No impact if proper controls like patching, disabling symbolic links, or avoiding untrusted repositories are implemented.

🌐 Internet-Facing: MEDIUM - Requires user interaction (cloning malicious repo) but public exploit exists and Git LFS is default on Windows.
🏢 Internal Only: MEDIUM - Internal developers could clone malicious repos from compromised internal sources or external attacks.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploit requires victim to clone malicious repository. Public proof-of-concept demonstrates command execution. No authentication needed beyond repository access.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.30.1, 2.29.3, 2.28.1, 2.27.1, 2.26.3, 2.25.5, 2.24.4, 2.23.4, 2.22.5, 2.21.4, 2.20.5, 2.19.6, 2.18.5, 2.17.6

Vendor Advisory: https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks

Restart Required: No

Instructions:

1. Update Git to patched version using package manager or official installer. 2. For Windows: Download latest Git for Windows from https://git-scm.com/. 3. For macOS: Use Homebrew 'brew upgrade git' or download from official site. 4. Verify version with 'git --version'.

🔧 Temporary Workarounds

Disable symbolic links globally

all

Prevents symbolic link processing during clone operations

git config --global core.symlinks false

Remove Git LFS filters

all

Unconfigure clean/smudge filters before cloning repositories

git config --global --unset filter.lfs.clean
git config --global --unset filter.lfs.smudge

🧯 If You Can't Patch

  • Only clone repositories from trusted sources and verify repository integrity
  • Use case-sensitive file systems or virtual machines with Linux for Git operations

🔍 How to Verify

Check if Vulnerable:

Check Git version and if on Windows/macOS with Git LFS configured: 'git --version' and 'git config --global --list | grep filter'

Check Version:

git --version

Verify Fix Applied:

Confirm Git version is patched: 'git --version' should show 2.30.1 or later patched version

📡 Detection & Monitoring

Log Indicators:

  • Unusual Git clone operations from unknown sources
  • Process execution from Git checkout directories

Network Indicators:

  • Git clone traffic to suspicious repositories
  • Unexpected outbound connections after Git operations

SIEM Query:

Process creation where parent process is git.exe or git and command line contains clone or checkout

🔗 References

📤 Share & Export