Vulnerability · Published Apr 14, 2020 · Assigned by GitHub_M
CVE-2020-5260malicious URLs may cause Git to present stored credentials to the wrong server
Critical 9.3
In plain English
A critical-severity improper input validation in git from git. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 14.9% (higher than 97% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | git | 2.26.1-r0 | ALPINE-CVE-2020-5260 |
| Alpine:v3.21 | git | 2.26.1-r0 | ALPINE-CVE-2020-5260 |
| Alpine:v3.22 | git | 2.26.1-r0 | ALPINE-CVE-2020-5260 |
| Alpine:v3.23 | git | 2.26.1-r0 | ALPINE-CVE-2020-5260 |
| Alpine:v3.24 | git | 2.26.1-r0 | ALPINE-CVE-2020-5260 |
| Debian:12 | git | 1:2.26.1-1 | DEBIAN-CVE-2020-5260 |
| Debian:13 | git | 1:2.26.1-1 | DEBIAN-CVE-2020-5260 |
| Debian:14 | git | 1:2.26.1-1 | DEBIAN-CVE-2020-5260 |
Affected products (as reported)
Weakness: CWE-20 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
References
- https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q x_refsource_CONFIRM
- https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b x_refsource_MISC
- https://lore.kernel.org/git/xmqqy2qy7xn8.fsf%40gitster.c.googlers.com/ x_refsource_MISC
- DSA-4657 vendor-advisory, x_refsource_DEBIAN
- [debian-lts-announce] 20200415 [SECURITY] [DLA 2177-1] git security update mailing-list, x_refsource_MLIST
- [oss-security] 20200415 CVE-2020-5260: Git: malicious URLs may cause Git to present stored credentials to the wrong server mailing-list, x_refsource_MLIST
- http://packetstormsecurity.com/files/157250/Git-Credential-Helper-Protocol-Newline-Injection.html x_refsource_MISC
- [oss-security] 20200415 Re: CVE-2020-5260: Git: malicious URLs may cause Git to present stored credentials to the wrong server mailing-list, x_refsource_MLIST
- openSUSE-SU-2020:0524 vendor-advisory, x_refsource_SUSE
- https://support.apple.com/kb/HT211141 x_refsource_CONFIRM
- FEDORA-2020-cdef88bb89 vendor-advisory, x_refsource_FEDORA
- [oss-security] 20200420 CVE-2020-11008: Git: Malicious URLs can still cause Git to send a stored credential to the wrong server mailing-list, x_refsource_MLIST
- GLSA-202004-13 vendor-advisory, x_refsource_GENTOO
- FEDORA-2020-c6548b488f vendor-advisory, x_refsource_FEDORA
- FEDORA-2020-f6b3b6fb18 vendor-advisory, x_refsource_FEDORA
- FEDORA-2020-b2a2c830cf vendor-advisory, x_refsource_FEDORA
- USN-4329-1 vendor-advisory, x_refsource_UBUNTU
- FEDORA-2020-4e093619bb vendor-advisory, x_refsource_FEDORA
- openSUSE-SU-2020:0598 vendor-advisory, x_refsource_SUSE