CVE-2021-21300 malicious repositories can execute remote code while cloning
Attackers can execute arbitrary code by cloning malicious repositories with symbolic links and clean/smudge filters on case-insensitive file systems.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-21300?
CVE-2021-21300 is a high-severity code injection vulnerability in Apple Xcode, published on 9 Mar 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-59
Which versions are affected by CVE-2021-21300?
It affects 4 products.
Linux distribution packages (37)
git SUSE:Enterprise Storage 6 | All versions | 2.26.2-3.31.1 |
git SUSE:HPE Helion OpenStack 8 | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 2.31.1-10.3.1 |
git SUSE:Linux Enterprise Module for Development Tools 15 SP2 | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Module for Development Tools 15 SP3 | All versions | 2.31.1-10.3.1 |
git SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server 12 SP2-LTSS | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server 12 SP5 | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Server 15-LTSS | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 2.26.2-27.43.1 |
git SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 2.26.2-3.31.1 |
git SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 2.26.2-27.43.1 |
git SUSE:Manager Proxy 4.0 | All versions | 2.26.2-3.31.1 |
git SUSE:Manager Retail Branch Server 4.0 | All versions | 2.26.2-3.31.1 |
git SUSE:Manager Server 4.0 | All versions | 2.26.2-3.31.1 |
git SUSE:OpenStack Cloud 7 | All versions | 2.26.2-27.43.1 |
git SUSE:OpenStack Cloud 8 | All versions | 2.26.2-27.43.1 |
git SUSE:OpenStack Cloud 9 | All versions | 2.26.2-27.43.1 |
git SUSE:OpenStack Cloud Crowbar 8 | All versions | 2.26.2-27.43.1 |
git SUSE:OpenStack Cloud Crowbar 9 | All versions | 2.26.2-27.43.1 |
git openSUSE:Leap 15.2 | All versions | 2.26.2-lp152.2.6.1 |
git openSUSE:Leap 15.3 | All versions | 2.31.1-10.3.1 |
git-annex openSUSE:Tumbleweed | All versions | 8.20210903-1.2 |
Products include Apple Xcode, Debian Debian Linux, Fedoraproject Fedora, Git-Scm Git.
How do I fix CVE-2021-21300?
Upgrade to a fixed version.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2021-21300 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-21300 exists.
Public exploit code: 1 Metasploit module and 14 proofs of concept on GitHub.
Other vulnerabilities in Apple Xcode
Sources
Also known as ALPINE-CVE-2021-21300, CLEANSTART-2026-PC25111, DEBIAN-CVE-2021-21300, GHSA-8prw-h3cq-mghm, MGASA-2021-0137, OESA-2021-1105 and 8 more.