{"id":"CVE-2021-21300","published":"2021-03-09T00:00:00Z","modified":"2024-08-03T18:09:15Z","title":"malicious repositories can execute remote code while cloning","vendor":"git","product":"git","tier":"core","eol":null,"affectedVersions":[{"vendor":"git","product":"git","versions":[">= 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":{"text":"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.","provenance":"source","from":"CVE.org"},"summary":{"text":"A flaw in Git, the open-source distributed revision control system, lets a specially crafted repository containing symbolic links and files that use a clean/smudge filter (such as Git LFS) cause a checked-out script to run during cloning on case-insensitive file systems like NTFS, HFS+ or APFS. An attacker who supplies such a repository can execute code on the victim's machine when they clone it, provided the clean/smudge filters are configured beforehand and the victim performs the clone, with Git for Windows affected by default because it configures Git LFS.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T07:12:36Z"},"cvss":{"score":8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.88533,"percentile":0.99772,"date":"2026-10-29","provenance":"source"},"kev":null,"vulncheckKev":null,"exploited":false,"otx":{"pulseCount":2,"pulses":[{"name":"University of Alberta Vulns & Exploits -ACTIVE- 09.26.26","url":"https://otx.alienvault.com/pulse/6ab83c469d15fb75aa60af2a","created":"2026-09-26"},{"name":"University of Alberta - Active Exploits in the Wild","url":"https://otx.alienvault.com/pulse/69cf54dc2c334d92d90ad45b","created":"2026-04-03"}],"provenance":"machine"},"cwes":[{"id":"CWE-59","name":"Improper Link Resolution Before File Access"}],"references":[{"url":"https://github.com/git/git/security/advisories/GHSA-8prw-h3cq-mghm","tags":[]},{"url":"https://lore.kernel.org/git/xmqqim6019yd.fsf%40gitster.c.googlers.com/","tags":[]},{"url":"https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks","tags":[]},{"url":"https://git-scm.com/docs/gitattributes#_filter","tags":[]},{"url":"https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592","tags":[]},{"url":"http://www.openwall.com/lists/oss-security/2021/03/09/3","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LCLJJLKKMS5WRFO6C475AOUZTWQLIARX/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LMXX2POK5X576BSDWSXGU7EIK6I72ERU/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BBPNGLQSYJHLZZ37BO42YY6S5OTIF4L4/","tags":["vendor-advisory"]},{"url":"https://support.apple.com/kb/HT212320","tags":[]},{"url":"http://seclists.org/fulldisclosure/2021/Apr/60","tags":["mailing-list"]},{"url":"https://security.gentoo.org/glsa/202104-01","tags":["vendor-advisory"]},{"url":"http://packetstormsecurity.com/files/163978/Git-LFS-Clone-Command-Execution.html","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/10/msg00014.html","tags":["mailing-list"]}],"techniques":[],"reports":[],"affected":[],"advisories":[],"euvd":{"id":"EUVD-2021-8658","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-8658","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[],"exploitSources":{"pocGithub":{"count":5,"skipped":9,"earliest":"2021-03-11","earliestUrl":"https://github.com/Maskhe/CVE-2021-21300","repos":[{"name":"Maskhe/CVE-2021-21300","url":"https://github.com/Maskhe/CVE-2021-21300","stars":1,"created":"2021-03-11"},{"name":"1uanWu/CVE-2021-21300","url":"https://github.com/1uanWu/CVE-2021-21300","stars":0,"created":"2021-03-11"},{"name":"Roboterh/CVE-2021-21300","url":"https://github.com/Roboterh/CVE-2021-21300","stars":0,"created":"2022-08-13"},{"name":"henry861010/Network_Security_NYCU","url":"https://github.com/henry861010/Network_Security_NYCU","stars":0,"created":"2023-05-04"},{"name":"the-chivalrousZ/cve-2021-21300","url":"https://github.com/the-chivalrousZ/cve-2021-21300","stars":0,"created":"2025-10-28"}]},"metasploit":[{"name":"Git LFS Clone Command Exec","module":"exploit/multi/http/git_lfs_clone_command_exec","type":"exploit","disclosureDate":"2021-04-26","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/git_lfs_clone_command_exec.rb"}],"first":{"date":"2021-03-11","source":"PoC-in-GitHub","url":"https://github.com/Maskhe/CVE-2021-21300"},"provenance":"source"},"exploitRefs":["http://packetstormsecurity.com/files/163978/Git-LFS-Clone-Command-Execution.html"],"flow":[],"timeline":[{"date":"2021-03-09","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2021-21300","provenance":"source"},{"date":"2021-03-11","kind":"exploit-public","label":"First public exploit: PoC-in-GitHub; later: Metasploit 2021-04-26","url":"https://github.com/Maskhe/CVE-2021-21300","provenance":"source"}],"speed":{"daysToPublicExploit":2,"firstExploitFrom":"PoC-in-GitHub","daysToKev":null},"priority":{"score":31.6,"factors":[{"name":"In a KEV catalog","points":0.0,"detail":"not listed"},{"name":"Recent KEV listing","points":0.0,"detail":"not listed"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.95,"detail":"percentile 0.9977"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"1 NVD exploit link; 5 PoC-in-GitHub repos; 1 Metasploit module"},{"name":"Mentioned in OTX pulses","points":1.08,"detail":"2 pulses"},{"name":"CVSS severity","points":5.6,"detail":"base score 8"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]}}