malicious repositories can execute remote code while cloning
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Partial Red Hat: 3 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Git | git | 2.14.2 to before 2.17.62.17.6; 2.18.0 to before 2.18.5; 2.19.0 to before 2.19.6; 2.20.0 to before 2.20.5; 2.21.0 to before 2.21.4; 2.22.0 to before 2.22.5; 2.23.0 to before 2.23.4; 2.24.0 to before 2.24.4; 2.25.0 to before 2.25.5; 2.26.0 to before 2.26.3; 2.27.0 to before 2.27.1; 2.28.0 to before 2.28.1; 2.29.0 to before 2.29.3; 2.30.0 to before 2.30.1 | 2.17.62.17.6, 2.18.5, 2.19.6, 2.20.5, 2.21.4, 2.22.5, 2.23.4, 2.24.4, 2.25.5, 2.26.3, 2.27.1, 2.28.1, 2.29.3, 2.30.1 | Patch available | CNA |
- git VendorGit Affected 2.14.2 to before 2.17.62.17.6; 2.18.0 to before 2.18.5; 2.19.0 to before 2.19.6; 2.20.0 to before 2.20.5; 2.21.0 to before 2.21.4; 2.22.0 to before 2.22.5; 2.23.0 to before 2.23.4; 2.24.0 to before 2.24.4; 2.25.0 to before 2.25.5; 2.26.0 to before 2.26.3; 2.27.0 to before 2.27.1; 2.28.0 to before 2.28.1; 2.29.0 to before 2.29.3; 2.30.0 to before 2.30.1 Fixed in 2.17.62.17.6, 2.18.5, 2.19.6, 2.20.5, 2.21.4, 2.22.5, 2.23.4, 2.24.4, 2.25.5, 2.26.3, 2.27.1, 2.28.1, 2.29.3, 2.30.1 Patch available CNA
CPE configurations NVD · 9
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* | up to 2.14.2; 2.17.0 to before 2.17.6; 2.18.0 to before 2.18.5; 2.19.0 to before 2.19.6; 2.20.0 to before 2.20.5; 2.21.0 to before 2.21.4; 2.22.0 to before 2.22.5; 2.23.0 to before 2.23.4; 2.24.0 to before 2.24.4; 2.25.0 to before 2.25.5; 2.26.0 to before 2.26.3; 2.29.0 to before 2.29.3; 2.30.0 to before 2.30.2 | Vulnerable | Git-scm |
| cpe:2.3:a:git-scm:git:2.27.0:*:*:*:*:*:*:* | 2.27.0 | Vulnerable | Git-scm |
| cpe:2.3:a:git-scm:git:2.28.0:*:*:*:*:*:*:* | 2.28.0 | Vulnerable | Git-scm |
| cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:* | 32 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
| cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:* | before 12.5 | Vulnerable | Apple |
| cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:* | 11.0 | Running on | Apple |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
- cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:* Versions up to 2.14.2; 2.17.0 to before 2.17.6; 2.18.0 to before 2.18.5; 2.19.0 to before 2.19.6; 2.20.0 to before 2.20.5; 2.21.0 to before 2.21.4; 2.22.0 to before 2.22.5; 2.23.0 to before 2.23.4; 2.24.0 to before 2.24.4; 2.25.0 to before 2.25.5; 2.26.0 to before 2.26.3; 2.29.0 to before 2.29.3; 2.30.0 to before 2.30.2 Vulnerable ·Git-scm
- cpe:2.3:a:git-scm:git:2.27.0:*:*:*:*:*:*:* Versions 2.27.0 Vulnerable ·Git-scm
- cpe:2.3:a:git-scm:git:2.28.0:*:*:*:*:*:*:* Versions 2.28.0 Vulnerable ·Git-scm
- cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:* Versions 32 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
- cpe:2.3:a:apple:xcode:*:*:*:*:*:*:*:* Versions before 12.5 Vulnerable ·Apple
- cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:* Versions 11.0 Running on ·Apple
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
Remediation
- Fix · CNA git (git) Fixed in 2.17.62.17.6, 2.18.5, 2.19.6, 2.20.5, 2.21.4, 2.22.5, 2.23.4, 2.24.4, 2.25.5, 2.26.3, 2.27.1, 2.28.1, 2.29.3, 2.30.1
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Software Collections | Affected | No fix planned: Will not fix |
Not affected: 4 products
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift Container Platform 3.11
- Red Hat OpenShift Container Platform 4
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21300
References
Exploit 2
Advisory 10
- https://github.com/git/git/security/advisories/GHSA-8prw-h3cq-mghm
- https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks
- https://git-scm.com/docs/gitattributes#_filter
- FEDORA-2021-63fcbd126e
- FEDORA-2021-ffd0b2108d
- FEDORA-2021-03e61a6647
- https://support.apple.com/kb/HT212320
- 20210427 APPLE-SA-2021-04-26-10 Xcode 12.5
- GLSA-202104-01
- [debian-lts-announce] 20221010 [SECURITY] [DLA 3145-1] git security update
More Git vulnerabilities
- TI-2025-30709 Git allows arbitrary code execution through broken config quoting KEVCVSS 3.1HIGH 8.1
- TI-2022-07580 gitattributes parsing integer overflow in git CVSS 3.1CRITICAL 9.8
- TI-2022-20244 Integer overflow in `git archive`, `git log --format` leading to RCE in git CVSS 3.1CRITICAL 9.8
- TI-2024-21101 Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution CVSS 3.1CRITICAL 9.1
- TI-2023-10933 "git apply --reject" partially-controlled arbitrary file write CVSS 3.1HIGH 7.5
- TI-2024-21116 Local Git clone may hardlink arbitrary user-readable files into the new repository's "objects/" directory CVSS 3.1HIGH 7.1
Sources
- CVE-2021-21300 · CVE Program
- CVE-2021-21300 · NVD
- FIRST EPSS
- CVE-2021-21300 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences