CVE-2021-21300
malicious repositories can execute remote code while cloning
Reported by github_m · Published March 9, 2021
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| git | Alpine | 2.30.2-r0, 2.26.3-r0, 2.24.4-r0, 2.22.5-r0 |
| git-svn | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-email | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-core-doc | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-daemon | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-core | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| perl-Git | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| gitweb | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-cvs | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-gui | Amazon Linux | 2.23.4-1.amzn2.0.1 |
| git-p4 | Amazon Linux | 2.23.4-1.amzn2.0.1 |
5 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| git | git | >= 2.14.2, < 2.17.62.17.6, >= 2.18.0, < 2.18.5, >= 2.19.0, < 2.19.6 |
| git | git | 2.14.2, 2.18.0, 2.19.0 |
Timeline
- Mar 9, 2021 CVE Published
- Mar 9, 2021 PoC Published (20 in total, the first dated here)
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Mar 7, 2026 Distribution Patch
- Mar 7, 2026 Security Advisory (5 in total, the first dated here)
- Aug 26, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-21300
vulnetix vdb fixes CVE-2021-21300
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-21300/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- [oss-security] 20210309 git: malicious repositories can execute remote code while cloning mailing-list
- FEDORA-2021-63fcbd126e vendor-advisory
- FEDORA-2021-ffd0b2108d vendor-advisory
- FEDORA-2021-03e61a6647 vendor-advisory
- 20210427 APPLE-SA-2021-04-26-10 Xcode 12.5 mailing-list
- GLSA-202104-01 vendor-advisory
- [debian-lts-announce] 20221010 [SECURITY] [DLA 3145-1] git security update mailing-list