CVE-2024-32002

9.0 CRITICAL

📋 TL;DR

This CVE describes a vulnerability in Git where specially crafted repositories with submodules can trick Git into writing files into a .git/ directory instead of the intended submodule worktree. This allows attackers to plant malicious hooks that execute during clone operations before users can inspect the code. All Git users cloning repositories from untrusted sources are affected.

💻 Affected Systems

Products:
  • Git
Versions: All versions prior to 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4
Operating Systems: All operating systems running Git
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability requires symbolic link support enabled (default). Disabling core.symlinks prevents exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution during git clone operations, allowing complete compromise of the system performing the clone.

🟠

Likely Case

Attackers could execute arbitrary code on developer machines or CI/CD systems when they clone malicious repositories.

🟢

If Mitigated

No impact if patched versions are used or if repositories are only cloned from trusted sources.

🌐 Internet-Facing: HIGH - Attackers can host malicious repositories on public platforms like GitHub.
🏢 Internal Only: MEDIUM - Risk exists if internal developers clone external repositories or if internal repositories are compromised.

🎯 Exploit Status

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

Exploitation requires creating a specially crafted repository with malicious submodules. Public proof-of-concept exists in security advisories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, or 2.39.4

Vendor Advisory: https://github.com/git/git/security/advisories/GHSA-8h77-4q3w-gfgv

Restart Required: No

Instructions:

1. Update Git to one of the patched versions. 2. For Linux/macOS: Use package manager (apt, yum, brew). 3. For Windows: Download from git-scm.com. 4. Verify update with 'git --version'.

🔧 Temporary Workarounds

Disable symbolic links

all

Prevents exploitation by disabling Git's symbolic link support

git config --global core.symlinks false

Disable submodule recursion

all

Avoid automatic submodule cloning during repository operations

git clone --no-recurse-submodules <repository>

🧯 If You Can't Patch

  • Only clone repositories from trusted, verified sources
  • Implement network controls to restrict Git operations to approved repositories

🔍 How to Verify

Check if Vulnerable:

Run 'git --version' and compare against affected versions list. If version is older than patched versions, system is vulnerable.

Check Version:

git --version

Verify Fix Applied:

Run 'git --version' and confirm version is 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, or 2.39.4 or newer.

📡 Detection & Monitoring

Log Indicators:

  • Unusual git clone operations from unknown sources
  • Git hook execution errors during clone operations

Network Indicators:

  • Git clone requests to unknown or suspicious repositories

SIEM Query:

source="git.log" AND (operation="clone" AND (source_ip NOT IN trusted_ips OR repository NOT IN trusted_repos))

🔗 References

📤 Share & Export