Skip to content
OpenAdvisories
High · 8.0 Public exploit CVE-2021-21300 EUVD-2021-8658

malicious repositories can execute remote code while cloning

Published Mar 9, 2021 · Updated Aug 3, 2024 · Assigned by GitHub_M

Description

Git is an open-source distributed revision control system. In affected versions of Git a specially crafted repository that contains symbolic links as well as files using a clean/smudge filter such as Git LFS, may cause just-checked out script to be executed while cloning onto a case-insensitive file system such as NTFS, HFS+ or APFS (i.e. the default file systems on Windows and macOS). Note that clean/smudge filters have to be configured for that. Git for Windows configures Git LFS by default, and is therefore vulnerable. The problem has been patched in the versions published on Tuesday, March 9th, 2021. As a workaound, if symbolic link support is disabled in Git (e.g. via `git config --global core.symlinks false`), the described attack won't work. Likewise, if no clean/smudge filters such as Git LFS are configured globally (i.e. _before_ cloning), the attack is foiled. As always, it is best to avoid cloning repositories from untrusted sources. The earliest impacted version is 2.14.2. The fix versions are: 2.30.1, 2.29.3, 2.28.1, 2.27.1, 2.26.3, 2.25.5, 2.24.4, 2.23.4, 2.22.5, 2.21.4, 2.20.5, 2.19.6, 2.18.5, 2.17.62.17.6.

Affected products

VendorProductAffectedFixed
git git >= 2.14.2, < 2.17.62.17.6, >= 2.18.0, < 2.18.5, >= 2.19.0, < 2.19.6, >= 2.20.0, < 2.20.5, >= 2.21.0, < 2.21.4, >= 2.22.0, < 2.22.5, >= 2.23.0, < 2.23.4, >= 2.24.0, < 2.24.4, >= 2.25.0, < 2.25.5, >= 2.26.0, < 2.26.3, >= 2.27.0, < 2.27.1, >= 2.28.0, < 2.28.1, >= 2.29.0, < 2.29.3, >= 2.30.0, < 2.30.1 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 git 1:2.30.2-1 —
Debian 13 git 1:2.30.2-1 —
Debian 12 git 1:2.30.2-1 —
Debian 10 git 1:2.20.1-2+deb10u4 DLA-3145-1
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS git 1:2.25.1-1ubuntu3.1 USN-4761-1
Ubuntu 18.04 LTS git 1:2.17.1-1ubuntu0.8 USN-4761-1
Ubuntu 16.04 LTS git 1:2.7.4-0ubuntu1.10 USN-4761-1
ReleasePackageFixed inAdvisory
SLES 15 SP3 git 2.31.1-10.3.1 SUSE-SU-2021:2555-1
SLES 15 SP2 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SLES 15 SP1 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SLES 15 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SLES 12 SP5 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
Show 21 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP4 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLES 12 SP3 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLES 12 SP2 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLES for SAP 15 SP1 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SLES for SAP 15 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SLES for SAP 12 SP5 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLES for SAP 12 SP4 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLES for SAP 12 SP3 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLES for SAP 12 SP2 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SLE HPC 15 SP1 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SLE HPC 15 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SUSE OpenStack Cloud Crowbar 9 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SUSE OpenStack Cloud Crowbar 8 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SUSE OpenStack Cloud 9 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SUSE OpenStack Cloud 8 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SUSE OpenStack Cloud 7 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SUSE Manager Server 4.0 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SUSE Manager Retail Branch Server 4.0 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SUSE Manager Proxy 4.0 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
SUSE HPE Helion OpenStack 8 git 2.26.2-27.43.1 SUSE-SU-2021:0756-1
SUSE Enterprise Storage 6 git 2.26.2-3.31.1 SUSE-SU-2021:0757-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed git 2.33.0-1.3 openSUSE-SU-2024:10786-1
openSUSE Tumbleweed git-annex 8.20210903-1.2 openSUSE-SU-2024:10787-1
openSUSE Leap 15.3 git 2.31.1-10.3.1 openSUSE-SU-2021:2555-1
openSUSE Leap 15.2 git 2.26.2-lp152.2.6.1 openSUSE-SU-2021:0405-1
ReleasePackageFixed inAdvisory
Alpine v3.24 git 2.30.2-r0 —
Alpine v3.23 git 2.30.2-r0 —
Alpine v3.22 git 2.30.2-r0 —
Alpine v3.21 git 2.30.2-r0 —
Alpine v3.20 git 2.30.2-r0 —
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 git 2.30.2-r0 —
Alpine v3.18 git 2.30.2-r0 —
Alpine v3.17 git 2.30.2-r0 —
Alpine v3.16 git 2.30.2-r0 —
Alpine v3.15 git 2.30.2-r0 —
Alpine v3.14 git 2.30.2-r0 —
Alpine v3.13 git 2.30.2-r0 —
Alpine v3.12 git 2.26.3-r0 —
Alpine v3.11 git 2.24.4-r0 —
Alpine v3.10 git 2.22.5-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2 git +15 2.23.4-1.amzn2.0.1 ALAS2-2021-1621

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Metasploit 1 module

GitHub 15 repositories · most starred shown

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 11

References