llamaCVEVulnerability Intelligence
/
git-lfs

CVE-2022-24826

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

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
9.8
Crítica
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Fuente: CNA
7.8NVD · CVSS 3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
ExplotaciónSin evidenciaSSVC: ninguna · no figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición1.676 dDesde la divulgación, 19 abr 2022, 6:35 p. m.
Detección1.658 dDesde la divulgación hasta su ingreso al índice
Decisión SSVCAtender
Priorizar en el próximo ciclo de cambios
Sin explotación conocida, automatizable e impacto técnico total. No hay versión corregida: aplique mitigaciones.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Evaluación SSVC +1
Explotación
Remediación
Parche v3.1.3
Monitoreo
Detectada
Verificada
19 abr 22
23 abr 25
3 nov 26
13 nov 26
21 nov 26
19 abr 22
13 jun 23
5 ago 24
28 sept 25
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada CVE-2022-24826 divulgada · CVSS 9.8 (CNA)
Remediación Parche v3.1.3 github.com/git-lfs/git-lfs/v3 · 0 d desde divulgación
Divulgación Evaluación SSVC CISA-ADP · explotación ninguna
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen

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.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · CNA
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
github.com/git-lfs/git-lfs≥ 2.12.1
github.com/git-lfs/git-lfs/v3≥ 3.0.0 < 3.1.3
v2.5.2+incompatible
2.12.1
3.0.0
3.1.3
v3.8.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/git-lfs/git-lfs/v3
Corregida v3.1.3 0 d v3.8.1 no afectada
gogithub.com/git-lfs/git-lfs
Sin parche — — v2.5.2+incompatible no afectada
Versiones corregidas3.1.3v3.1.3
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Fabricantehttps://github.com/git-lfs/git-lfs/security/advisories/GHSA-6rw3-3whw-jvjj
Otrahttps://github.com/git-lfs/git-lfs/releases

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.