CVE-2021-21300malicious repositories can execute remote code while cloning
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.
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 20.04 | git | Fixed | 1:2.25.1-1ubuntu3.1 | UBUNTU-CVE-2021-21300 |
| Ubuntu 18.04 | git | Fixed | 1:2.17.1-1ubuntu0.8 | UBUNTU-CVE-2021-21300 |
| Ubuntu 16.04 | git | Fixed | 1:2.7.4-0ubuntu1.10 | UBUNTU-CVE-2021-21300 |
| Debian 14 | git | Fixed | 1:2.30.2-1 | DEBIAN-CVE-2021-21300 |
| Debian 13 | git | Fixed | 1:2.30.2-1 | DEBIAN-CVE-2021-21300 |
| Debian 12 | git | Fixed | 1:2.30.2-1 | DEBIAN-CVE-2021-21300 |
| Red Hat Enterprise Linux 9 | git | Not affected | ||
| Red Hat Enterprise Linux 9 | git-all | Not affected | ||
| Red Hat Enterprise Linux 9 | git-core | Not affected | ||
| Red Hat Enterprise Linux 9 | git-core-doc | Not affected | ||
| Red Hat Enterprise Linux 9 | git-credential-libsecret | Not affected | ||
| Red Hat Enterprise Linux 9 | git-daemon | Not affected | ||
| Red Hat Enterprise Linux 9 | git-email | Not affected | ||
| Red Hat Enterprise Linux 9 | git-gui | Not affected | ||
| Red Hat Enterprise Linux 9 | git-instaweb | Not affected | ||
| Red Hat Enterprise Linux 9 | git-subtree | Not affected | ||
| Red Hat Enterprise Linux 9 | git-svn | Not affected | ||
| Red Hat Enterprise Linux 9 | gitk | Not affected | ||
| Red Hat Enterprise Linux 9 | gitweb | Not affected | ||
| Red Hat Enterprise Linux 9 | perl-Git | Not affected | ||
| Red Hat Enterprise Linux 9 | perl-Git-SVN | Not affected | ||
| Red Hat Enterprise Linux 8 | git | Not affected | ||
| Red Hat Enterprise Linux 8 | git-all | Not affected | ||
| Red Hat Enterprise Linux 8 | git-core | Not affected | ||
| Red Hat Enterprise Linux 8 | git-core-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | git-credential-libsecret | Not affected | ||
| Red Hat Enterprise Linux 8 | git-daemon | Not affected | ||
| Red Hat Enterprise Linux 8 | git-email | Not affected | ||
| Red Hat Enterprise Linux 8 | git-gui | Not affected | ||
| Red Hat Enterprise Linux 8 | git-instaweb | Not affected | ||
| Red Hat Enterprise Linux 8 | git-subtree | Not affected | ||
| Red Hat Enterprise Linux 8 | git-svn | Not affected | ||
| Red Hat Enterprise Linux 8 | gitk | Not affected | ||
| Red Hat Enterprise Linux 8 | gitweb | Not affected | ||
| Red Hat Enterprise Linux 8 | perl-Git | Not affected | ||
| Red Hat Enterprise Linux 8 | perl-Git-SVN | Not affected | ||
| Red Hat Enterprise Linux 7 | emacs-git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | emacs-git-el | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-all | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-bzr | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-cvs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-daemon | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-email | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-gnome-keyring | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-gui | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-hg | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-instaweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-p4 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-svn | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | gitk | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | gitweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Git-SVN | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | emacs-git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | emacs-git-el | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-all | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-cvs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-daemon | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-email | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-gui | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-svn | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | gitk | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | gitweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | perl-Git | Will not fix Out of support scope | ||
| Alpine Linux 3.24 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.23 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.22 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.21 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.20 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.19 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.18 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.17 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.16 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.15 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.14 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.13 | git | Fixed | 2.30.2-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.12 | git | Fixed | 2.26.3-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.11 | git | Fixed | 2.24.4-r0 | ALPINE-CVE-2021-21300 |
| Alpine Linux 3.10 | git | Fixed | 2.22.5-r0 | ALPINE-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.
- git: affected: >= 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
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://security.gentoo.org/glsa/202104-01 (vendor-advisory)
References
- https://github.com/git/git/security/advisories/GHSA-8prw-h3cq-mghm
- https://lore.kernel.org/git/xmqqim6019yd.fsf%40gitster.c.googlers.com/
- https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks
- https://git-scm.com/docs/gitattributes#_filter
- https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592
- http://www.openwall.com/lists/oss-security/2021/03/09/3
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LCLJJLKKMS5WRFO6C475AOUZTWQLIARX/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LMXX2POK5X576BSDWSXGU7EIK6I72ERU/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BBPNGLQSYJHLZZ37BO42YY6S5OTIF4L4/
- https://support.apple.com/kb/HT212320
- http://seclists.org/fulldisclosure/2021/Apr/60
- https://security.gentoo.org/glsa/202104-01
- http://packetstormsecurity.com/files/163978/Git-LFS-Clone-Command-Execution.html
- https://lists.debian.org/debian-lts-announce/2022/10/msg00014.html
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.