Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2022-24826

CRITICAL 9.8EPSS 67%

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

Also known as BIT-git-lfs-2022-24826, GHSA-6rw3-3whw-jvjj

Mitigation

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

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

Vulnerability facts

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
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 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
EPSS
1.17% chance of exploitation in 30 days (percentile 67, 2026-11-26)
CWE
CWE-426
Published
Modified

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

Package / productAffectedFixedSource
Go github.com/git-lfs/git-lfs/v3>= 3.0.0, < 3.1.33.1.3osv
Go github.com/git-lfs/git-lfs>= 2.12.1—osv
git-lfs3.1.3—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

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.

References

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.

Sponsors