# CVE-2022-24826: Git LFS can execute a binary from the current directory on Windows

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.17% (percentile 67, 2026-11-26)
- **CWE:** CWE-426
- **Aliases:** BIT-git-lfs-2022-24826, GHSA-6rw3-3whw-jvjj
- **Published:** 2022-04-19T23:35:11.000Z
- **Modified:** 2026-06-17T04:32:36.373Z

## Who should check

- Projects that depend on Go package github.com/git-lfs/git-lfs/v3 (\>= 3.0.0, \< 3.1.3)
- Projects that depend on Go package github.com/git-lfs/git-lfs (\>= 2.12.1)
- Anyone running git-lfs 3.1.3

## Description

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.

## Affected and fixed versions

- Go `github.com/git-lfs/git-lfs/v3`: affected \>= 3.0.0, \< 3.1.3; fixed 3.1.3 (osv)
- Go `github.com/git-lfs/git-lfs`: affected \>= 2.12.1; fixed no fix listed yet (osv)
- git-lfs: 3.1.3 (cvelist)

## Mitigation

- Upgrade github.com/git-lfs/git-lfs/v3 to 3.1.3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-24826. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-24826.md
Affected: github.com/git-lfs/git-lfs/v3 >= 3.0.0, < 3.1.3; github.com/git-lfs/git-lfs >= 2.12.1
Fixed in: 3.1.3

Steps:
1. Search this machine and project for github.com/git-lfs/git-lfs/v3 (Go), github.com/git-lfs/git-lfs (Go), git-lfs: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-24826 being exploited?

There is no confirmed exploitation: CVE-2022-24826 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.17% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-24826?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2022-24826?

github.com/git-lfs/git-lfs/v3 \>= 3.0.0, \< 3.1.3; github.com/git-lfs/git-lfs \>= 2.12.1.

### Is there a fix for CVE-2022-24826?

Yes. Fixed in 3.1.3. Upgrade github.com/git-lfs/git-lfs/v3 to 3.1.3 or later.

### How do I check if I'm affected by CVE-2022-24826?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/git-lfs/git-lfs/security/advisories/GHSA-6rw3-3whw-jvjj>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2022-24826>
- other: <https://github.com/git-lfs/git-lfs/releases>
- other: <https://github.com/git-lfs/git-lfs>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-24826>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-6rw3-3whw-jvjj> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2022-24826> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-24826>
