CVE-2020-5260

malicious URLs may cause Git to present stored credentials to the wrong server

9.3 critical EPSS 14.8%

Published 14 Apr 2020 Updated 4 Aug 2024 CNA: GitHub_M

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.

Check my servers

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)

9.3 critical CVSS 3.1 from GitHub_M (CNA)
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.

ProductVersions
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-5260

RHEL, Rocky, Alma, Fedora

rpm -q git
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2020-5260

Alpine

apk list --installed | grep -i git

With 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

Other references

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.