cbcvebase.
CVE-2021-21300
published 2021-03-09

CVE-2021-21300: 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…

PriorityP275high7.5CVSS 3.1
AVNACHPRNUIRSUCHIHAH
EXPLOIT
EPSS
88.64%
99.8th percentile
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

44 ranges· showing 25
VendorProductVersion rangeFixed in
applexcode< 12.512.5
debiandebian_linux
debiangit< git 1:2.30.2-1 (bookworm)git 1:2.30.2-1 (bookworm)
fedoraprojectfedora
fedoraprojectfedora
fedoraprojectfedora
git-scmgit<= 2.14.2
git-scmgit
git-scmgit
git-scmgit>= 2.17.0 < 2.17.62.17.6
git-scmgit>= 2.18.0 < 2.18.52.18.5
git-scmgit>= 2.19.0 < 2.19.62.19.6
git-scmgit>= 2.20.0 < 2.20.52.20.5
git-scmgit>= 2.21.0 < 2.21.42.21.4
git-scmgit>= 2.22.0 < 2.22.52.22.5
git-scmgit>= 2.23.0 < 2.23.42.23.4
git-scmgit>= 2.24.0 < 2.24.42.24.4
git-scmgit>= 2.25.0 < 2.25.52.25.5
git-scmgit>= 2.26.0 < 2.26.32.26.3
git-scmgit>= 2.29.0 < 2.29.32.29.3
git-scmgit>= 2.30.0 < 2.30.22.30.2
gitgit
gitgit
gitgit
gitgit

Detection & IOCsextracted from sources · hover to see the quote

path.git/hooks/post-checkout
path.git/hooks
  • Monitor for unexpected creation or modification of files inside the `.git/hooks/` directory during a `git clone` operation, especially `post-checkout`, which is the default hook written by the Metasploit exploit module.
  • Detect exploitation attempts by monitoring for symbolic links being checked out alongside files processed by clean/smudge filters (e.g., Git LFS) during clone operations on case-insensitive file systems (NTFS, HFS+, APFS).
  • Alert on `git clone` processes that spawn unexpected child processes, particularly on Windows (NTFS) or macOS (HFS+/APFS) systems, as the exploit causes a checked-out script to execute automatically during clone.
  • Flag Git clients with `core.symlinks` set to true (default) AND Git LFS configured globally, as both conditions together are required for exploitation.
  • Git for Windows installations should be treated as vulnerable by default since Git LFS is configured out-of-the-box, making all default Git for Windows installs susceptible without additional hardening.
  • ·The exploit requires BOTH symbolic link support enabled (core.symlinks=true, which is the default) AND a clean/smudge filter such as Git LFS configured globally before cloning. Disabling either condition independently prevents exploitation.
  • ·The vulnerability is specific to case-insensitive file systems (NTFS, HFS+, APFS). Typical Linux case-sensitive file systems are not affected, though exploitation is possible on Linux under certain circumstances (e.g., ext4 per-directory case-insensitive directories).
  • ·The earliest impacted Git version is 2.14.2; versions 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, and 2.17.6 contain the fix.
  • ·Red Hat CodeReady Studio 12 is not affected because it uses jgit (a Java Git implementation), not the native git binary.

CVSS provenance

nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
nvdv2.05.1MEDIUMAV:N/AC:H/Au:N/C:P/I:P/A:P
osv7.5HIGH
vendor_msrc8.8HIGH
vendor_debian8.0HIGH
vendor_redhat8.0HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.