CVE-2022-24826
Git LFS vulnerability analysis and mitigation

Overview

On Windows, Git LFS versions 2.12.1 through 3.1.2 contain a vulnerability that allows arbitrary code execution when operating on a malicious repository. The vulnerability was discovered and disclosed in April 2022, affecting the Git Large File Storage (LFS) extension (GitHub Advisory, NVD).

Technical details

The vulnerability occurs when Git LFS detects that a program it intends to run does not exist in any directory listed in PATH. In this case, Git LFS passes an empty string as the executable file path to the Go os/exec package. On Windows, this package contains a bug where it prepends the current working directory (.) to the empty string without adding a path separator. This causes it to search for and execute files with base name . combined with any extension from PATHEXT in the current directory. The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (High) with vector AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (GitHub Advisory).

Impact

An attacker can exploit this vulnerability by creating a malicious repository containing a ..exe file along with a file named git.exe (or similar combinations). When Git LFS operates on this repository and cannot find the intended program in PATH, it will execute the malicious ..exe file instead, allowing arbitrary code execution. This vulnerability only affects Windows systems (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in Git LFS version 3.1.3. Users of affected versions should upgrade to version 3.1.3 or later. The fix ensures that Git LFS always reports an error when a program is not found in PATH rather than passing an empty string to the Go os/exec package. There are no known workarounds for this vulnerability (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Git LFS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2020-27955CRITICAL9.8
  • Git LFSGit LFS
  • git-lfs
NoYesNov 05, 2020
CVE-2025-26625HIGH8.6
  • Git LFSGit LFS
  • cpe:2.3:a:git_large_file_storage_project:git_large_file_storage
NoYesOct 17, 2025
CVE-2024-53263HIGH8.5
  • Rocky LinuxRocky Linux
  • github.com/git-lfs/git-lfs/v3
NoYesJan 14, 2025
CVE-2022-24826HIGH7.8
  • Git LFSGit LFS
  • cpe:2.3:a:git_large_file_storage_project:git_large_file_storage
NoYesApr 20, 2022
CVE-2021-21237HIGH7.8
  • Git LFSGit LFS
  • git-lfs
NoYesJan 15, 2021

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management