CVE-2020-5260
malicious URLs may cause Git to present stored credentials to the wrong server
Check your servers for CVE-2020-5260
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2020-5260 affects git, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality high, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 14.8%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 97.3% of all scored CVEs. Scores of 29 Nov 2026.
Weakness
- CWE-20 Improper Input Validation
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| git |
affected < 2.17.4 affected >= 2.18.0, < 2.18.3 affected >= 2.19.0, 2.19.4 affected >= 2.20.0, < 2.20.3 affected >= 2.21.0, < 2.21.2 affected >= 2.22.0, < 2.22.3 affected >= 2.23.0, < 2.23.2 affected >= 2.24.0, < 2.24.2 affected >= 2.25.0, < 2.25.3 affected >= 2.26.0, < 2.26.1
|
Is my server affected?
Find the installed version of git and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i git
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2020-5260 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2020-5260RHEL, Rocky, Alma, Fedora
rpm -q git
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2020-5260Alpine
apk list --installed | grep -i gitWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2020-5260
trivy image --scanners vuln IMAGE | grep CVE-2020-5260
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q github.com
- DSA-4657 debian.org · vendor advisory
- openSUSE-SU-2020:0524 lists.opensuse.org · vendor advisory
- https://support.apple.com/kb/HT211141 support.apple.com
- FEDORA-2020-cdef88bb89 lists.fedoraproject.org · vendor advisory
- GLSA-202004-13 security.gentoo.org · vendor advisory
- FEDORA-2020-c6548b488f lists.fedoraproject.org · vendor advisory
- FEDORA-2020-f6b3b6fb18 lists.fedoraproject.org · vendor advisory
- FEDORA-2020-b2a2c830cf lists.fedoraproject.org · vendor advisory
- USN-4329-1 usn.ubuntu.com · vendor advisory
- FEDORA-2020-4e093619bb lists.fedoraproject.org · vendor advisory
- openSUSE-SU-2020:0598 lists.opensuse.org · vendor advisory
Other references
- https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b github.com
- https://lore.kernel.org/git/xmqqy2qy7xn8.fsf%40gitster.c.googlers.com/ lore.kernel.org
- [debian-lts-announce] 20200415 [SECURITY] [DLA 2177-1] git security update lists.debian.org · mailing list
- [oss-security] 20200415 CVE-2020-5260: Git: malicious URLs may cause Git to present stored credentials to the wrong… openwall.com · mailing list
- http://packetstormsecurity.com/files/157250/Git-Credential-Helper-Protocol-Newline-Injection.html packetstormsecurity.com
- [oss-security] 20200415 Re: CVE-2020-5260: Git: malicious URLs may cause Git to present stored credentials to the… openwall.com · mailing list
- [oss-security] 20200420 CVE-2020-11008: Git: Malicious URLs can still cause Git to send a stored credential to the… openwall.com · mailing list
Source: the record CVE-2020-5260 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse