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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.0
- **CVSS:** 8.0 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 90.76% (percentile 100, 2026-11-29)
- **CWE:** CWE-59
- **Published:** 2021-03-09T00:00:00.000Z
- **Modified:** 2026-06-17T03:35:14.770Z

## Who should check

- Anyone running git \>= 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; \>= 2.23.0, \< 2.23.4; \>= 2.24.0, \< 2.24.4; \>= 2.25.0, \< 2.25.5; \>= 2.26.0, \< 2.26.3; …

## Description

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 and fixed versions

- git: \>= 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; \>= 2.23.0, \< 2.23.4; \>= 2.24.0, \< 2.24.4; \>= 2.25.0, \< 2.25.5; \>= 2.26.0, \< 2.26.3; … (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-21300. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-21300.md
Affected: git >= 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; >= 2.23.0, < 2.23.4; >= 2.24.0, < 2.24.4; >= 2.25.0, < 2.25.5; >= 2.26.0, < 2.26.3; …
Fixed in: git 2.17.62.17.6, git 2.18.5, git 2.19.6, git 2.20.5, git 2.21.4, git 2.22.5, git 2.23.4, git 2.24.4, git 2.25.5, git 2.26.3

Steps:
1. Search this machine and project for git: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-21300 being exploited?

There is no confirmed exploitation: CVE-2021-21300 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 90.76% chance of exploitation in the next 30 days (as of 2026-11-29).

### How serious is CVE-2021-21300?

High: CVSS 8.0 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2021-21300?

git \>= 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; \>= 2.23.0, \< 2.23.4; \>= 2.24.0, \< 2.24.4; \>= 2.25.0, \< 2.25.5; \>= 2.26.0, \< 2.26.3; ….

### Is there a fix for CVE-2021-21300?

Yes. Fixed in git 2.17.62.17.6, git 2.18.5, git 2.19.6, git 2.20.5, git 2.21.4, git 2.22.5, git 2.23.4, git 2.24.4, git 2.25.5, git 2.26.3. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2021-21300?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/git/git/security/advisories/GHSA-8prw-h3cq-mghm>
- vendor: <https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks>
- vendor: <https://git-scm.com/docs/gitattributes#_filter>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LCLJJLKKMS5WRFO6C475AOUZTWQLIARX/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LMXX2POK5X576BSDWSXGU7EIK6I72ERU/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BBPNGLQSYJHLZZ37BO42YY6S5OTIF4L4/>
- vendor: <https://security.gentoo.org/glsa/202104-01>
- patch: <https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592>
- exploit: <http://www.openwall.com/lists/oss-security/2021/03/09/3>
- exploit: <http://packetstormsecurity.com/files/163978/Git-LFS-Clone-Command-Execution.html>
- other: <https://lore.kernel.org/git/xmqqim6019yd.fsf%40gitster.c.googlers.com/>
- other: <https://support.apple.com/kb/HT212320>
- other: <http://seclists.org/fulldisclosure/2021/Apr/60>
- other: <https://lists.debian.org/debian-lts-announce/2022/10/msg00014.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-21300>

HTML: <https://flawdb.com/CVE-2021-21300> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-21300>
