CVE-2020-5260
malicious URLs may cause Git to present stored credentials to the wrong server
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
2Exploited in Wild
-Decision
Descriptions
Affected versions of Git have a vulnerability whereby Git can be tricked into sending private credentials to a host controlled by an attacker. Git uses external "credential helper" programs to store and retrieve passwords or other credentials from secure storage provided by the operating system. Specially-crafted URLs that contain an encoded newline can inject unintended values into the credential helper protocol stream, causing the credential helper to retrieve the password for one server (e.g., good.example.com) for an HTTP request being made to another server (e.g., evil.example.com), resulting in credentials for the former being sent to the latter. There are no restrictions on the relationship between the two, meaning that an attacker can craft a URL that will present stored credentials for any host to a host of their choosing. The vulnerability can be triggered by feeding a malicious URL to git clone. However, the affected URLs look rather suspicious; the likely vector would be through systems which automatically clone URLs not visible to the user, such as Git submodules, or package systems built around Git. The problem has been patched in the versions published on April 14th, 2020, going back to v2.17.x. Anyone wishing to backport the change further can do so by applying commit 9a6bbee (the full release includes extra checks for git fsck, but that commit is sufficient to protect clients against the vulnerability). The patched versions are: 2.17.4, 2.18.3, 2.19.4, 2.20.3, 2.21.2, 2.22.3, 2.23.2, 2.24.2, 2.25.3, 2.26.1.
Las versiones afectadas de Git presentan una vulnerabilidad por la cual Git puede ser engañado para enviar credenciales privadas a un host controlado por un atacante. Git usa programas externos de "credential helper" para almacenar y recuperar contraseñas u otras credenciales del almacenamiento seguro provistas por el sistema operativo. Las URL especialmente diseñadas que contienen una nueva línea codificada pueden inyectar valores no deseados en la secuencia del protocolo credential helper, causando que el asistente de credenciales recupere la contraseña de un servidor (por ejemplo, good.example.com) para una petición HTTP que se lleva a cabo en otro servidor ( por ejemplo, evil.example.com), resultando en que las credenciales para el primero se envíen al segundo. No existen restricciones en la relación entre los dos, lo que significa que un atacante puede crear una URL que presente credenciales almacenadas para cualquier host a un host de su elección. La vulnerabilidad puede ser activada alimentando una URL maliciosa a git clone. Sin embargo, las URL afectadas lucen bastante sospechosas; el vector probable sería por medio de sistemas que clonan automáticamente las URL no visibles para el usuario, como submódulos de Git o sistemas de paquetes creados alrededor de Git. El problema se ha corregido en las versiones publicadas el 14 de abril de 2020, que se remontan a las versiones v2.17.x. Cualquiera que desee respaldar el cambio aún más puede hacerlo aplicando el commit 9a6bbee (la versión completa incluye comprobaciones adicionales para git fsck, pero ese commit es suficiente para proteger a los clientes contra la vulnerabilidad). Las versiones parcheadas son: 2.17.4, 2.18.3, 2.19.4, 2.20.3, 2.21.2, 2.22.3, 2.23.2, 2.24.2, 2.25.3, 2.26.1.
A flaw was found in git. Credentials can be leaked through the use of a crafted URL that contains a newline, fooling the credential helper to give information for a different host. Highest threat from the vulnerability is to data confidentiality.
A git clone action can leak cached / stored credentials for github.com to example.com due to insecure handling of newlines in the credential helper protocol.
CVSS Scores
SSVC
- Decision:-
Timeline
- 2020-01-02 CVE Reserved
- 2020-04-14 CVE Published
- 2020-04-15 First Exploit
- 2024-05-24 EPSS Updated
- 2024-08-04 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
CWE
- CWE-20: Improper Input Validation
- CWE-522: Insufficiently Protected Credentials
CAPEC
References (23)
URL | Tag | Source |
---|---|---|
http://packetstormsecurity.com/files/157250/Git-Credential-Helper-Protocol-Newline-Injection.html | Third Party Advisory | |
http://www.openwall.com/lists/oss-security/2020/04/15/5 | Mailing List | |
http://www.openwall.com/lists/oss-security/2020/04/15/6 | Mailing List | |
http://www.openwall.com/lists/oss-security/2020/04/20/1 | Mailing List | |
https://lists.debian.org/debian-lts-announce/2020/04/msg00010.html | Mailing List | |
https://lore.kernel.org/git/xmqqy2qy7xn8.fsf%40gitster.c.googlers.com | X_refsource_misc | |
https://support.apple.com/kb/HT211141 | Third Party Advisory |
URL | Date | SRC |
---|---|---|
https://github.com/sv3nbeast/CVE-2020-5260 | 2020-04-16 | |
https://github.com/Asgavar/CVE-2020-5260 | 2020-04-15 |
URL | Date | SRC |
---|---|---|
https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b | 2023-11-07 | |
https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q | 2023-11-07 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Git Search vendor "Git" | Git Search vendor "Git" for product "Git" | < 2.17.4 Search vendor "Git" for product "Git" and version " < 2.17.4" | - |
Affected
| ||||||
Git Search vendor "Git" | Git Search vendor "Git" for product "Git" | >= 2.22.0 < 2.22.3 Search vendor "Git" for product "Git" and version " >= 2.22.0 < 2.22.3" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.18.0 < 2.18.3 Search vendor "Git-scm" for product "Git" and version " >= 2.18.0 < 2.18.3" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.19.0 < 2.19.4 Search vendor "Git-scm" for product "Git" and version " >= 2.19.0 < 2.19.4" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.20.0 < 2.20.3 Search vendor "Git-scm" for product "Git" and version " >= 2.20.0 < 2.20.3" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.21.0 < 2.21.2 Search vendor "Git-scm" for product "Git" and version " >= 2.21.0 < 2.21.2" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.23.0 < 2.23.2 Search vendor "Git-scm" for product "Git" and version " >= 2.23.0 < 2.23.2" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.24.0 < 2.24.2 Search vendor "Git-scm" for product "Git" and version " >= 2.24.0 < 2.24.2" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.25.0 < 2.25.3 Search vendor "Git-scm" for product "Git" and version " >= 2.25.0 < 2.25.3" | - |
Affected
| ||||||
Git-scm Search vendor "Git-scm" | Git Search vendor "Git-scm" for product "Git" | >= 2.26.0 < 2.26.1 Search vendor "Git-scm" for product "Git" and version " >= 2.26.0 < 2.26.1" | - |
Affected
| ||||||
Canonical Search vendor "Canonical" | Ubuntu Linux Search vendor "Canonical" for product "Ubuntu Linux" | 16.04 Search vendor "Canonical" for product "Ubuntu Linux" and version "16.04" | lts |
Affected
| ||||||
Canonical Search vendor "Canonical" | Ubuntu Linux Search vendor "Canonical" for product "Ubuntu Linux" | 18.04 Search vendor "Canonical" for product "Ubuntu Linux" and version "18.04" | lts |
Affected
| ||||||
Canonical Search vendor "Canonical" | Ubuntu Linux Search vendor "Canonical" for product "Ubuntu Linux" | 19.10 Search vendor "Canonical" for product "Ubuntu Linux" and version "19.10" | - |
Affected
| ||||||
Debian Search vendor "Debian" | Debian Linux Search vendor "Debian" for product "Debian Linux" | 8.0 Search vendor "Debian" for product "Debian Linux" and version "8.0" | - |
Affected
| ||||||
Debian Search vendor "Debian" | Debian Linux Search vendor "Debian" for product "Debian Linux" | 9.0 Search vendor "Debian" for product "Debian Linux" and version "9.0" | - |
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
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 30 Search vendor "Fedoraproject" for product "Fedora" and version "30" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 31 Search vendor "Fedoraproject" for product "Fedora" and version "31" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 32 Search vendor "Fedoraproject" for product "Fedora" and version "32" | - |
Affected
| ||||||
Opensuse Search vendor "Opensuse" | Leap Search vendor "Opensuse" for product "Leap" | 15.1 Search vendor "Opensuse" for product "Leap" and version "15.1" | - |
Affected
|