CVE-2021-21300
malicious repositories can execute remote code while cloning
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
12Exploited in Wild
-Decision
Descriptions
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.
Git es un sistema de control de revisiones distribuido de código abierto. En las versiones afectadas de Git, un repositorio especialmente diseñado que contiene enlaces simbólicos, así como archivos que usan un filtro clean/smudge como Git LFS, puede hacer que se ejecute un script recién extraído mientras se clona en un sistema de archivos que no distingue entre mayúsculas y minúsculas como NTFS , HFS+ o APFS (es decir, los sistemas de archivos predeterminados en Windows y macOS). Tome en cuenta que los filtros de clean/smudge deben ser configurados para eso. Git para Windows configura Git LFS por defecto y, por lo tanto, es vulnerable. El problema se ha corregido en las versiones publicadas el martes 9 de marzo de 2021. Como solución temporal, si el soporte de enlace simbólico está deshabilitado en Git (por ejemplo, por medio de "git config --global core.symlinks false"), el ataque descrito no funcionará. Del mismo modo, si no se configuran globalmente filtros clean/smudge como Git LFS (es decir,_before_ cloning), el ataque se frustra. Como siempre, es mejor evitar la clonación de repositorios de fuentes no confiables. La primera versión afectada es 2.14.2. Las versiones correctas son: 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
CVSS Scores
SSVC
- Decision:-
Timeline
- 2020-12-22 CVE Reserved
- 2021-03-09 CVE Published
- 2021-03-10 First Exploit
- 2024-08-03 CVE Updated
- 2024-10-04 EPSS Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
CWE
- CWE-59: Improper Link Resolution Before File Access ('Link Following')
CAPEC
References (24)
URL | Tag | Source |
---|---|---|
http://seclists.org/fulldisclosure/2021/Apr/60 | Mailing List | |
https://github.com/git/git/security/advisories/GHSA-8prw-h3cq-mghm | Third Party Advisory | |
https://lists.debian.org/debian-lts-announce/2022/10/msg00014.html | Mailing List | |
https://lore.kernel.org/git/xmqqim6019yd.fsf%40gitster.c.googlers.com | ||
https://support.apple.com/kb/HT212320 | Third Party Advisory |
URL | Date | SRC |
---|---|---|
https://github.com/AlkenePan/CVE-2021-21300 | 2021-03-10 | |
https://github.com/Maskhe/CVE-2021-21300 | 2021-03-11 | |
https://github.com/1uanWu/CVE-2021-21300 | 2021-03-11 | |
https://github.com/Roboterh/CVE-2021-21300 | 2022-08-13 | |
https://github.com/Saboor-Hakimi-23/CVE-2021-21300 | 2023-10-28 | |
https://github.com/Kirill89/CVE-2021-21300 | 2021-03-11 | |
https://github.com/erranfenech/CVE-2021-21300 | 2021-03-10 | |
https://github.com/fengzhouc/CVE-2021-21300 | 2021-04-06 | |
https://github.com/danshuizhangyu/CVE-2021-21300 | 2021-04-08 | |
https://github.com/Faisal78123/CVE-2021-21300 | 2021-03-18 | |
http://packetstormsecurity.com/files/163978/Git-LFS-Clone-Command-Execution.html | 2024-08-03 | |
http://www.openwall.com/lists/oss-security/2021/03/09/3 | 2024-08-03 |
URL | Date | SRC |
---|---|---|
https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592 | 2023-11-07 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Apple Search vendor "Apple" | Xcode Search vendor "Apple" for product "Xcode" | < 12.5 Search vendor "Apple" for product "Xcode" and version " < 12.5" | - |
Affected
| in | Apple Search vendor "Apple" | Macos Search vendor "Apple" for product "Macos" | >= 11.0 Search vendor "Apple" for product "Macos" and version " >= 11.0" | - |
Safe
|
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | <= 2.14.2 Search vendor "Git-scm" for product "Git" and version " <= 2.14.2" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.17.0 < 2.17.6 Search vendor "Git-scm" for product "Git" and version " >= 2.17.0 < 2.17.6" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.18.0 < 2.18.5 Search vendor "Git-scm" for product "Git" and version " >= 2.18.0 < 2.18.5" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.19.0 < 2.19.6 Search vendor "Git-scm" for product "Git" and version " >= 2.19.0 < 2.19.6" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.20.0 < 2.20.5 Search vendor "Git-scm" for product "Git" and version " >= 2.20.0 < 2.20.5" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.21.0 < 2.21.4 Search vendor "Git-scm" for product "Git" and version " >= 2.21.0 < 2.21.4" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.22.0 < 2.22.5 Search vendor "Git-scm" for product "Git" and version " >= 2.22.0 < 2.22.5" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.23.0 < 2.23.4 Search vendor "Git-scm" for product "Git" and version " >= 2.23.0 < 2.23.4" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.24.0 < 2.24.4 Search vendor "Git-scm" for product "Git" and version " >= 2.24.0 < 2.24.4" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.25.0 < 2.25.5 Search vendor "Git-scm" for product "Git" and version " >= 2.25.0 < 2.25.5" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.26.0 < 2.26.3 Search vendor "Git-scm" for product "Git" and version " >= 2.26.0 < 2.26.3" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.29.0 < 2.29.3 Search vendor "Git-scm" for product "Git" and version " >= 2.29.0 < 2.29.3" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.30.0 < 2.30.2 Search vendor "Git-scm" for product "Git" and version " >= 2.30.0 < 2.30.2" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | 2.27.0 Search vendor "Git-scm" for product "Git" and version "2.27.0" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | 2.28.0 Search vendor "Git-scm" for product "Git" and version "2.28.0" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 32 Search vendor "Fedoraproject" for product "Fedora" and version "32" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 33 Search vendor "Fedoraproject" for product "Fedora" and version "33" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 34 Search vendor "Fedoraproject" for product "Fedora" and version "34" | - |
Affected
| ||||||
Debian Search vendor "Debian" | Debian Linux Search vendor "Debian" for product "Debian Linux" | 10.0 Search vendor "Debian" for product "Debian Linux" and version "10.0" | - |
Affected
|