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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| git | 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, >= 2.27.0, < 2.27.1, >= 2.28.0, < 2.28.1, >= 2.29.0, < 2.29.3, >= 2.30.0, < 2.30.1 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | git | 1:2.30.2-1 | — |
| Debian 13 | git | 1:2.30.2-1 | — |
| Debian 12 | git | 1:2.30.2-1 | — |
| Debian 10 | git | 1:2.20.1-2+deb10u4 | DLA-3145-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | git | 1:2.25.1-1ubuntu3.1 | USN-4761-1 |
| Ubuntu 18.04 LTS | git | 1:2.17.1-1ubuntu0.8 | USN-4761-1 |
| Ubuntu 16.04 LTS | git | 1:2.7.4-0ubuntu1.10 | USN-4761-1 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP3 | git | 2.31.1-10.3.1 | SUSE-SU-2021:2555-1 |
| SLES 15 SP2 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SLES 15 SP1 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SLES 15 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SLES 12 SP5 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
Show 21 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP4 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLES 12 SP3 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLES 12 SP2 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLES for SAP 15 SP1 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SLES for SAP 15 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SLES for SAP 12 SP5 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLES for SAP 12 SP4 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLES for SAP 12 SP3 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLES for SAP 12 SP2 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SLE HPC 15 SP1 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SLE HPC 15 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SUSE OpenStack Cloud Crowbar 9 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SUSE OpenStack Cloud Crowbar 8 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SUSE OpenStack Cloud 9 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SUSE OpenStack Cloud 8 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SUSE OpenStack Cloud 7 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SUSE Manager Server 4.0 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SUSE Manager Retail Branch Server 4.0 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SUSE Manager Proxy 4.0 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
| SUSE HPE Helion OpenStack 8 | git | 2.26.2-27.43.1 | SUSE-SU-2021:0756-1 |
| SUSE Enterprise Storage 6 | git | 2.26.2-3.31.1 | SUSE-SU-2021:0757-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | git | 2.33.0-1.3 | openSUSE-SU-2024:10786-1 |
| openSUSE Tumbleweed | git-annex | 8.20210903-1.2 | openSUSE-SU-2024:10787-1 |
| openSUSE Leap 15.3 | git | 2.31.1-10.3.1 | openSUSE-SU-2021:2555-1 |
| openSUSE Leap 15.2 | git | 2.26.2-lp152.2.6.1 | openSUSE-SU-2021:0405-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | git | 2.30.2-r0 | — |
| Alpine v3.23 | git | 2.30.2-r0 | — |
| Alpine v3.22 | git | 2.30.2-r0 | — |
| Alpine v3.21 | git | 2.30.2-r0 | — |
| Alpine v3.20 | git | 2.30.2-r0 | — |
Show 10 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | git | 2.30.2-r0 | — |
| Alpine v3.18 | git | 2.30.2-r0 | — |
| Alpine v3.17 | git | 2.30.2-r0 | — |
| Alpine v3.16 | git | 2.30.2-r0 | — |
| Alpine v3.15 | git | 2.30.2-r0 | — |
| Alpine v3.14 | git | 2.30.2-r0 | — |
| Alpine v3.13 | git | 2.30.2-r0 | — |
| Alpine v3.12 | git | 2.26.3-r0 | — |
| Alpine v3.11 | git | 2.24.4-r0 | — |
| Alpine v3.10 | git | 2.22.5-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2 | git +15 | 2.23.4-1.amzn2.0.1 | ALAS2-2021-1621 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
Git LFS Clone Command Exec
exploit/multi/http/git_lfs_clone_command_exec
GitHub 15 repositories · most starred shown
-
Maskhe/CVE-2021-21300 ★ 1 · Mar 11, 2021
-
Roboterh/CVE-2021-21300 ★ 0 · Aug 13, 2022
the payload of CVE-2021-21300
-
danshuizhangyu/CVE-2021-21300 ★ 0 · Apr 7, 2021
-
fengzhouc/CVE-2021-21300 ★ 0 · Apr 6, 2021
-
ETOCheney/cve-2021-21300 ★ 0 · Mar 15, 2021
-
1uanWu/CVE-2021-21300 ★ 0 · Mar 11, 2021
remote code exec for git
-
Kirill89/CVE-2021-21300 ★ 0 · Mar 11, 2021
-
AlkenePan/CVE-2021-21300 ★ 0 · Mar 10, 2021
-
Faisal78123/CVE-2021-21300 ★ 0 · Mar 10, 2021
-
erranfenech/CVE-2021-21300 ★ 0 · Mar 10, 2021
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 11
- DLA-3145-1 git - security update Debian Security (DSA / DLA) · Mar 9, 2026
- USN-4761-1 git vulnerability Ubuntu Security Notices (USN) · Feb 10, 2026
- openSUSE-SU-2021:0405-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:10786-1 git-2.33.0-1.3 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:10787-1 git-annex-8.20210903-1.2 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2021:2555-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2021:2555-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2021:0757-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2021:0756-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- VDE-2022-010 PHOENIX CONTACT: Multiple Linux component vulnerabilities fixed in latest AXC F x152 LTS release CERT@VDE · May 22, 2025
- ALAS2-2021-1621 Moderate: git security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Mar 25, 2021
References
- https://github.com/git/git/security/advisories/GHSA-8prw-h3cq-mghm
- https://lore.kernel.org/git/xmqqim6019yd.fsf%40gitster.c.googlers.com/
- https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks
- https://git-scm.com/docs/gitattributes#_filter
- https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592
- [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
- https://support.apple.com/kb/HT212320
- 20210427 APPLE-SA-2021-04-26-10 Xcode 12.5 mailing-list
- GLSA-202104-01 vendor-advisory
- http://packetstormsecurity.com/files/163978/Git-LFS-Clone-Command-Execution.html
- [debian-lts-announce] 20221010 [SECURITY] [DLA 3145-1] git security update mailing-list