Skip to content

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

High severity GitHub Reviewed Published Jan 13, 2021 in git-lfs/git-lfs • Updated Feb 14, 2023

Package

gomod github.com/git-lfs/git-lfs (Go)

Affected versions

< 2.13.2

Patched versions

2.13.2

Description

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.

References

@bk2204 bk2204 published to git-lfs/git-lfs Jan 13, 2021
Reviewed May 21, 2021
Published to the GitHub Advisory Database Feb 15, 2022
Last updated Feb 14, 2023

Severity

High
7.2
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N

CVE ID

CVE-2021-21237

GHSA ID

GHSA-cx3w-xqmc-84g5

Source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.