{"answers":{"affected":"5 open source packages ship an affected version, including github.com/git-lfs/git-lfs, git-lfs and github.com/git-lfs/git-lfs/v3. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-24826 in the wild and no public exploit code.","fix":"Upgrade to a fixed version.","what":"CVE-2022-24826 is a critical code injection vulnerability in git-lfs, published on 19 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-24826 and fix it if it is affected.\n\nWhat it is: CVE-2022-24826 is a critical code injection vulnerability in git-lfs, published on 19 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-24826 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/git-lfs/git-lfs (Go): affected from 2.12.1; no fix listed\n- github.com/git-lfs/git-lfs (Go): affected from 2.12.1; no fix listed\n- git-lfs (Bitnami): affected from 2.12.1; fixed in 3.1.3\n- github.com/git-lfs/git-lfs/v3 (Go): affected from 3.0.0; fixed in 3.1.3\n- github.com/git-lfs/git-lfs/v3 (Go): affected from 3.0.0; fixed in 3.1.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-24826/ (Markdown: https://insights.sbomify.com/CVE-2022-24826/index.md)","id":"CVE-2022-24826","markdown":"https://insights.sbomify.com/CVE-2022-24826/index.md","name":"CVE-2022-24826","record":{"aliases":["BIT-git-lfs-2022-24826","GHSA-6rw3-3whw-jvjj"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"Git LFS","requires_auth":"none","summary":"Git LFS on Windows may execute arbitrary code from the current directory if the intended executable is missing from PATH.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"git_large_file_storage","vendor":"git_large_file_storage_project"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-426","name":"Untrusted Search Path"}],"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.","ecosystems":["Bitnami","Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Git LFS can execute a binary from the current directory on Windows","id":"CVE-2022-24826","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"code_injection","year":"2022"},"n_packages":5,"n_references":2,"next":{"headline":"SQL Injection in elide-datastore-aggregation","id":"CVE-2022-24827"},"packages":[{"ecosystem":"Bitnami","fixed":["3.1.3"],"introduced":["2.12.1"],"last_affected":[],"package":"git-lfs","purl":"pkg:bitnami/git-lfs","source":"BIT-git-lfs-2022-24826"},{"ecosystem":"Go","fixed":[],"introduced":["2.12.1"],"last_affected":[],"package":"github.com/git-lfs/git-lfs","purl":null,"source":"GHSA-6rw3-3whw-jvjj"},{"ecosystem":"Go","fixed":[],"introduced":["2.12.1"],"last_affected":[],"package":"github.com/git-lfs/git-lfs","purl":"pkg:golang/github.com/git-lfs/git-lfs","source":"GHSA-6rw3-3whw-jvjj"},{"ecosystem":"Go","fixed":["3.1.3"],"introduced":["3.0.0"],"last_affected":[],"package":"github.com/git-lfs/git-lfs/v3","purl":null,"source":"GHSA-6rw3-3whw-jvjj"},{"ecosystem":"Go","fixed":["3.1.3"],"introduced":["3.0.0"],"last_affected":[],"package":"github.com/git-lfs/git-lfs/v3","purl":"pkg:golang/github.com/git-lfs/git-lfs/v3","source":"GHSA-6rw3-3whw-jvjj"}],"prev":{"headline":"Smokescreen SSRF via deny list bypass","id":"CVE-2022-24825"},"products":["git-lfs"],"published":"2022-04-19","related":[{"cvss_score":9.8,"headline":"Git LFS can execute a Git binary from the current directory","id":"CVE-2020-27955","kev_date_added":null,"published":"2020-11-05"},{"cvss_score":8.8,"headline":"GitHub Git LFS Arbitrary command execution vulnerability","id":"CVE-2017-17831","kev_date_added":null,"published":"2017-12-21"},{"cvss_score":7.2,"headline":"Git LFS can execute a Git binary from the current directory on Windows","id":"CVE-2021-21237","kev_date_added":null,"published":"2021-01-15"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-23","vendors":["git-lfs"]},"summary":"Git LFS on Windows may execute arbitrary code from the current directory if the intended executable is missing from PATH.","url":"https://insights.sbomify.com/CVE-2022-24826/"}