CVEfocus › CVE database › CVE-2021-21300

CVE-2021-21300malicious repositories can execute remote code while cloning

CVSS 8.0 HighEPSS 90.8% (in the top 1% of all CVEs)Published 2021-03-09Updated 2024-08-03Assigner: GitHub_M

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.

CWE-59

What to do

Likely to be exploited: EPSS gives a 91% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from Alpine, Debian, Ubuntu: see the table below for the fixed version per release.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

21Fixed
30Will not fix
30Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 20.04gitFixed1:2.25.1-1ubuntu3.1UBUNTU-CVE-2021-21300
Ubuntu 18.04gitFixed1:2.17.1-1ubuntu0.8UBUNTU-CVE-2021-21300
Ubuntu 16.04gitFixed1:2.7.4-0ubuntu1.10UBUNTU-CVE-2021-21300
Debian 14gitFixed1:2.30.2-1DEBIAN-CVE-2021-21300
Debian 13gitFixed1:2.30.2-1DEBIAN-CVE-2021-21300
Debian 12gitFixed1:2.30.2-1DEBIAN-CVE-2021-21300
Red Hat Enterprise Linux 9gitNot affected
Red Hat Enterprise Linux 9git-allNot affected
Red Hat Enterprise Linux 9git-coreNot affected
Red Hat Enterprise Linux 9git-core-docNot affected
Red Hat Enterprise Linux 9git-credential-libsecretNot affected
Red Hat Enterprise Linux 9git-daemonNot affected
Red Hat Enterprise Linux 9git-emailNot affected
Red Hat Enterprise Linux 9git-guiNot affected
Red Hat Enterprise Linux 9git-instawebNot affected
Red Hat Enterprise Linux 9git-subtreeNot affected
Red Hat Enterprise Linux 9git-svnNot affected
Red Hat Enterprise Linux 9gitkNot affected
Red Hat Enterprise Linux 9gitwebNot affected
Red Hat Enterprise Linux 9perl-GitNot affected
Red Hat Enterprise Linux 9perl-Git-SVNNot affected
Red Hat Enterprise Linux 8gitNot affected
Red Hat Enterprise Linux 8git-allNot affected
Red Hat Enterprise Linux 8git-coreNot affected
Red Hat Enterprise Linux 8git-core-docNot affected
Red Hat Enterprise Linux 8git-credential-libsecretNot affected
Red Hat Enterprise Linux 8git-daemonNot affected
Red Hat Enterprise Linux 8git-emailNot affected
Red Hat Enterprise Linux 8git-guiNot affected
Red Hat Enterprise Linux 8git-instawebNot affected
Red Hat Enterprise Linux 8git-subtreeNot affected
Red Hat Enterprise Linux 8git-svnNot affected
Red Hat Enterprise Linux 8gitkNot affected
Red Hat Enterprise Linux 8gitwebNot affected
Red Hat Enterprise Linux 8perl-GitNot affected
Red Hat Enterprise Linux 8perl-Git-SVNNot affected
Red Hat Enterprise Linux 7emacs-gitWill not fix
Out of support scope
Red Hat Enterprise Linux 7emacs-git-elWill not fix
Out of support scope
Red Hat Enterprise Linux 7gitWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-allWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-bzrWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-cvsWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-daemonWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-emailWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-gnome-keyringWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-guiWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-hgWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-instawebWill not fix
Out of support scope
Red Hat Enterprise Linux 7git-p4Will not fix
Out of support scope
Red Hat Enterprise Linux 7git-svnWill not fix
Out of support scope
Red Hat Enterprise Linux 7gitkWill not fix
Out of support scope
Red Hat Enterprise Linux 7gitwebWill not fix
Out of support scope
Red Hat Enterprise Linux 7perl-GitWill not fix
Out of support scope
Red Hat Enterprise Linux 7perl-Git-SVNWill not fix
Out of support scope
Red Hat Enterprise Linux 6emacs-gitWill not fix
Out of support scope
Red Hat Enterprise Linux 6emacs-git-elWill not fix
Out of support scope
Red Hat Enterprise Linux 6gitWill not fix
Out of support scope
Red Hat Enterprise Linux 6git-allWill not fix
Out of support scope
Red Hat Enterprise Linux 6git-cvsWill not fix
Out of support scope
Red Hat Enterprise Linux 6git-daemonWill not fix
Out of support scope
Red Hat Enterprise Linux 6git-emailWill not fix
Out of support scope
Red Hat Enterprise Linux 6git-guiWill not fix
Out of support scope
Red Hat Enterprise Linux 6git-svnWill not fix
Out of support scope
Red Hat Enterprise Linux 6gitkWill not fix
Out of support scope
Red Hat Enterprise Linux 6gitwebWill not fix
Out of support scope
Red Hat Enterprise Linux 6perl-GitWill not fix
Out of support scope
Alpine Linux 3.24gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.23gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.22gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.21gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.20gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.19gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.18gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.17gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.16gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.15gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.14gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.13gitFixed2.30.2-r0ALPINE-CVE-2021-21300
Alpine Linux 3.12gitFixed2.26.3-r0ALPINE-CVE-2021-21300
Alpine Linux 3.11gitFixed2.24.4-r0ALPINE-CVE-2021-21300
Alpine Linux 3.10gitFixed2.22.5-r0ALPINE-CVE-2021-21300

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.