CVE-2024-52006

7.5 HIGH

📋 TL;DR

This vulnerability allows attackers to inject malicious commands into Git credential helpers by exploiting how some ecosystems interpret carriage return characters as newlines. It affects users of Git with credential helpers in .NET or Node.js ecosystems. The vulnerability bypasses previous protections from CVE-2020-5260.

💻 Affected Systems

Products:
  • Git
  • Git credential helpers in .NET ecosystem
  • Git credential helpers in Node.js ecosystem
Versions: Git versions before v2.48.1, v2.47.2, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, v2.40.4
Operating Systems: All operating systems running affected Git versions
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability specifically affects credential helpers that treat carriage returns as newlines, primarily in .NET and Node.js implementations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, credential theft, and lateral movement within the environment.

🟠

Likely Case

Credential theft from Git credential helpers, potentially exposing sensitive authentication tokens and passwords.

🟢

If Mitigated

Limited impact with proper network segmentation and restricted Git operations from untrusted sources.

🌐 Internet-Facing: MEDIUM - Exploitation requires cloning from attacker-controlled URLs, which is common in development workflows.
🏢 Internal Only: LOW - Internal Git servers with strict access controls and trusted repositories pose minimal risk.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires social engineering or tricking users into cloning from malicious repositories. The vulnerability bypasses previous fixes for similar issues.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v2.48.1, v2.47.2, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, v2.40.4

Vendor Advisory: https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q

Restart Required: No

Instructions:

1. Check current Git version with 'git --version'. 2. Upgrade Git using your package manager (apt, yum, brew, etc.) or download from git-scm.com. 3. Verify upgrade with 'git --version' again.

🔧 Temporary Workarounds

Avoid untrusted Git operations

all

Prevent exploitation by restricting Git operations to trusted sources only

🧯 If You Can't Patch

  • Avoid cloning from untrusted URLs, especially recursive clones
  • Implement network segmentation to isolate Git operations from sensitive systems

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

git --version

Verify Fix Applied:

Run 'git --version' and confirm version matches or exceeds v2.48.1, v2.47.2, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, or v2.40.4

📡 Detection & Monitoring

Log Indicators:

  • Unusual Git clone operations from unfamiliar URLs
  • Failed credential helper executions
  • Unexpected process spawns from Git operations

Network Indicators:

  • Git protocol traffic to suspicious or unknown repositories
  • Unusual outbound connections following Git operations

SIEM Query:

Process creation where parent process is git and command line contains suspicious parameters or URLs

🔗 References

📤 Share & Export