CVE-2022-24826

9.8 CRITICAL

📋 TL;DR

This vulnerability allows arbitrary code execution on Windows systems when Git LFS processes malicious repositories. Attackers can trick Git LFS into executing malicious programs named with a leading dot (like ..exe) instead of legitimate executables. Only affects Windows users running Git LFS versions 2.12.1 through 3.1.2.

💻 Affected Systems

Products:
  • Git LFS
Versions: 2.12.1 through 3.1.2
Operating Systems: Windows
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Windows systems. Unix systems are not vulnerable. Requires specific conditions: malicious repository with specially named files AND legitimate executables not found in PATH.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise through remote code execution when processing malicious Git repositories, potentially leading to data theft, ransomware deployment, or lateral movement.

🟠

Likely Case

Local privilege escalation or code execution when users clone or interact with malicious repositories, particularly in development environments.

🟢

If Mitigated

No impact if Git LFS is patched or if legitimate executables (git.exe, cygpath.exe) are properly found in PATH.

🌐 Internet-Facing: MEDIUM - Requires user interaction with malicious repositories, but common in development workflows.
🏢 Internal Only: MEDIUM - Internal developers frequently clone repositories from various sources, including potentially compromised ones.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW - Attackers need to create malicious repositories with specific file naming patterns.

Exploitation requires user interaction (cloning/processing malicious repo). The vulnerability details are publicly documented in the advisory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.1.3

Vendor Advisory: https://github.com/git-lfs/git-lfs/security/advisories/GHSA-6rw3-3whw-jvjj

Restart Required: No

Instructions:

1. Download Git LFS 3.1.3 or later from https://github.com/git-lfs/git-lfs/releases
2. Run the installer to upgrade
3. Verify installation with 'git lfs version'

🔧 Temporary Workarounds

Ensure Git executables in PATH

windows

Add legitimate git.exe and cygpath.exe to system PATH to prevent fallback to current directory execution.

setx PATH "%PATH%;C:\Path\To\Git\Bin"
setx PATH "%PATH%;C:\Path\To\Cygwin\Bin"

🧯 If You Can't Patch

  • Avoid cloning untrusted Git repositories, especially on Windows systems
  • Use Unix-based systems for Git operations when possible as they are not affected

🔍 How to Verify

Check if Vulnerable:

Check Git LFS version with 'git lfs version'. If version is between 2.12.1 and 3.1.2 inclusive, system is vulnerable.

Check Version:

git lfs version

Verify Fix Applied:

Run 'git lfs version' and confirm version is 3.1.3 or higher.

📡 Detection & Monitoring

Log Indicators:

  • Failed execution attempts of git.exe or cygpath.exe from current directory
  • Unexpected process execution with names starting with '..'

Network Indicators:

  • Cloning from unknown or suspicious Git repositories

SIEM Query:

Process creation where command line contains '..exe' or parent process is git-lfs.exe

🔗 References

📤 Share & Export