Read the docs
TI-2022-08639 Aliases CVE-2022-24826GHSA-6rw3-3whw-jvjj

Git LFS can execute a binary from the current directory on Windows

Priority MEDIUM 53CWE-426Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-426.

Summary

On Windows, if Git LFS operates on a malicious repository with a `..exe` file as well as a file named `git.exe`, and `git.exe` is not found in `PATH`, the `..exe` program will be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. Similarly, if the malicious repository contains files named `..exe` and `cygpath.exe`, and `cygpath.exe` is not found in `PATH`, the `..exe` program will be executed when certain Git LFS commands are run. More generally, if the current working directory contains any file with a base name of `.` and a file extension from `PATHEXT` (except `.bat` and `.cmd`), and also contains another file with the same base name as a program Git LFS intends to execute (such as `git`, `cygpath`, or `uname`) and any file extension from `PATHEXT` (including `.bat` and `.cmd`), then, on Windows, when Git LFS attempts to execute the intended program the `..exe`, `..com`, etc., file will be executed instead, but only if the intended program is not found in any directory listed in `PATH`. The vulnerability occurs because when Git LFS detects that the program it intends to run does not exist in any directory listed in `PATH` then Git LFS passes an empty string as the executable file path to the Go `os/exec` package, which contains a bug such that, on Windows, it prepends the name of the current working directory (i.e., `.`) to the empty string without adding a path separator, and as a result searches in that directory for a file with the base name `.` combined with any file extension from `PATHEXT`, executing the first one it finds. (The reason `..bat` and `..cmd` files are not executed in the same manner is that, although the Go `os/exec` package tries to execute them just as it does a `..exe` file, the Microsoft Win32 API `CreateProcess()` family of functions have an undocumented feature in that they apparently recognize when a caller is attempting to execute a batch script file and instead run the `cmd.exe` command interpreter, passing the full set of command line arguments as parameters. These are unchanged from the command line arguments set by Git LFS, and as such, the intended program's name is the first, resulting in a command line like `cmd.exe /c git`, which then fails.) Git LFS has resolved this vulnerability by always reporting an error when a program is not found in any directory listed in `PATH` rather than passing an empty string to the Go `os/exec` package in this case. The bug in the Go `os/exec` package has been reported to the Go project and is expected to be patched after this security advisory is published. The problem was introduced in version 2.12.1 and is patched in version 3.1.3. Users of affected versions should upgrade to version 3.1.3. There are currently no known workarounds at this time.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.02228 82nd percentileScored 2026-11-08
Fix Fixed github.com/git-lfs/git-lfs/v3 (Go): 3.1.3

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
Yes
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
git-lfsgit-lfs3.1.3—No fix listedCNA
—github.com/git-lfs/git-lfs/v3 (Go)3.0.0 to before 3.1.33.1.3Patch availableGHSA-6rw3-3whw-jvjj
—github.com/git-lfs/git-lfs (Go)2.12.1 and later—No fix listedGHSA-6rw3-3whw-jvjj
  • git-lfs Vendorgit-lfs Affected 3.1.3 Fixed in — No fix listed CNA
  • github.com/git-lfs/git-lfs/v3 (Go) Vendor— Affected 3.0.0 to before 3.1.3 Fixed in 3.1.3 Patch available GHSA-6rw3-3whw-jvjj
  • github.com/git-lfs/git-lfs (Go) Vendor— Affected 2.12.1 and later Fixed in — No fix listed GHSA-6rw3-3whw-jvjj

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:git_large_file_storage_project:git_large_file_storage:*:*:*:*:*:*:*:*2.12.1 to before 3.1.3VulnerableGit Large File Storage Project
  • cpe:2.3:a:git_large_file_storage_project:git_large_file_storage:*:*:*:*:*:*:*:* Versions 2.12.1 to before 3.1.3 Vulnerable ·Git Large File Storage Project

Remediation

  • Fix · GHSA-6rw3-3whw-jvjj github.com/git-lfs/git-lfs/v3 (Go) Fixed in 3.1.3 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-24826
  2. 2026-10-03 Alias added: GHSA-6rw3-3whw-jvjj

References

  • TI-2025-19562 Git LFS may write to arbitrary files via crafted symlinks CVSS 4.0HIGH 8.6
  • TI-2024-35726 Git LFS permits exfiltration of credentials via crafted HTTP URLs CVSS 4.0HIGH 8.5

Sources