VDB

CVE-2021-21300

CVE-2021-21300 PUBLISHED CVSS 8 HIGH

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.

PackageEcosystemFixed in
gitAlpine2.30.2-r0, 2.26.3-r0, 2.24.4-r0, 2.22.5-r0
git-svnAmazon Linux2.23.4-1.amzn2.0.1
git-emailAmazon Linux2.23.4-1.amzn2.0.1
git-core-docAmazon Linux2.23.4-1.amzn2.0.1
gitAmazon Linux2.23.4-1.amzn2.0.1
git-daemonAmazon Linux2.23.4-1.amzn2.0.1
git-coreAmazon Linux2.23.4-1.amzn2.0.1
perl-GitAmazon Linux2.23.4-1.amzn2.0.1
gitwebAmazon Linux2.23.4-1.amzn2.0.1
git-cvsAmazon Linux2.23.4-1.amzn2.0.1
git-guiAmazon Linux2.23.4-1.amzn2.0.1
git-p4Amazon Linux2.23.4-1.amzn2.0.1

5 more packages have a fixed version. See every fix in Lookup.

Risk scores

CVSS 3.1
8
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N

Affected products

VendorProductVersions
gitgit>= 2.14.2, < 2.17.62.17.6, >= 2.18.0, < 2.18.5, >= 2.19.0, < 2.19.6
gitgit2.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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›