CVE-2021-21237
JSON

7.2high

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

Severity
7.2high CVSS:3.1 by GitHub_M
Exploit likelihood
0.45% (higher than 41% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-cx3w-xqmc-84g5BIT-GIT-LFS-2021-21237GO-2021-0098

Description

Git LFS is a command line extension for managing large files with Git. On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. This is the result of an incomplete fix for CVE-2020-27955. This issue occurs because on Windows, Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator. Other than avoiding untrusted repositories or using a different operating system, there is no workaround. This is fixed in v2.13.2.

Affected

Product or packageVersionsReported by
git-lfs git-lfs< 2.13.2CVE List
github.com/git-lfs/git-lfs (Go)before 2.13.2, before 1.5.1-0.20210113180018-fc664697ed2cGitHub Advisory Database, Go Vulnerability Database
git_large_file_storage_project git_large_file_storagebefore 2.13.2NVD
git-lfs (Bitnami)before 2.13.2Bitnami Vulnerability Database

All scores

GitHub_M7.2high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
GitHub7.2high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD4.6medium CVSS:2.0AV:L/AC:L/Au:N/C:P/I:P/A:P
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

Git LFS is a command line extension for managing large files with Git. On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems. This is the result of an incomplete fix for CVE-2020-27955. This issue occurs because on Windows, Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator. Other than avoiding untrusted repositories or using a different operating system, there is no workaround. This is fixed in v2.13.2.

GitHub Advisory Database
Impact

On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitrary code. This does not affect Unix systems.

This is the result of an incomplete fix for CVE-2020-27955.

This issue occurs because on Windows, Go includes (and prefers) the current directory when the name of a command run does not contain a directory separator.

Patches

This version should be patched in v2.13.2, which will be released in coordination with this security advisory.

Workarounds

Other than avoiding untrusted repositories or using a different operating system, there is no workaround.

References

Are there any links users can visit to find out more?

For more information

If you have any questions or comments about this advisory:

  • Start a discussion in the Git LFS discussion page.
  • If you cannot open a discussion, please email the core team using their usernames at github.com.
Go Vulnerability Database

Due to the standard library behavior of exec.LookPath on Windows a number of methods may result in arbitrary code execution when cloning or operating on untrusted Git repositories.

NVD (es)

Git LFS es una extensión de línea de comandos para administrar archivos grandes con Git.&#xa0;En Windows, si Git LFS opera en un repositorio malicioso con un archivo git.bat o git.exe en el directorio actual, ese programa será ejecutado, permitiendo al atacante ejecutar código arbitrario.&#xa0;Esto no afecta a los sistemas Unix.&#xa0;Este es el resultado de una corrección incompleta para CVE-2020-27955.&#xa0;Este problema ocurre porque en Windows, Go incluye (y prefiere) el directorio actual cuando el nombre de un comando ejecutado no contiene un separador de directorio.&#xa0;Aparte de evitar los repositorios que no son confiables o usando un sistema operativo diferente, no se presenta una solución alternativa.&#xa0;Esto es corregido en versión v2.13.2

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21237 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-cx3w-xqmc-84g5 changed 2026-07-08CC-BY-4.0
Go Vulnerability DatabaseGO-2021-0098 changed 2024-05-20CC-BY-4.0
NVDCVE-2021-21237 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GIT-LFS-2021-21237 changed 2026-09-08Apache-2.0