malicious URLs may cause Git to present stored credentials to the wrong server
Published Apr 14, 2020
9.3
CRITICALCVSS 3.1
EPSS 10.05%
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 products
-
- Version < 2.17.4StatusaffectedConstraints-
- Version >= 2.18.0, < 2.18.3StatusaffectedConstraints-
- Version >= 2.19.0, 2.19.4StatusaffectedConstraints-
- Version >= 2.20.0, < 2.20.3StatusaffectedConstraints-
- Version >= 2.21.0, < 2.21.2StatusaffectedConstraints-
- Version >= 2.22.0, < 2.22.3StatusaffectedConstraints-
- Version >= 2.23.0, < 2.23.2StatusaffectedConstraints-
- Version >= 2.24.0, < 2.24.2StatusaffectedConstraints-
- Version >= 2.25.0, < 2.25.3StatusaffectedConstraints-
- Version >= 2.26.0, < 2.26.1StatusaffectedConstraints-
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Git | Git | n/a |
|
Configuration 1
- < 2.17.4
- ≥ 2.22.0 · < 2.22.3
- ≥ 2.18.0 · < 2.18.3
- ≥ 2.19.0 · < 2.19.4
- ≥ 2.20.0 · < 2.20.3
- ≥ 2.21.0 · < 2.21.2
- ≥ 2.23.0 · < 2.23.2
- ≥ 2.24.0 · < 2.24.2
- ≥ 2.25.0 · < 2.25.3
- ≥ 2.26.0 · < 2.26.1
Configuration 2
- 16.04
- 18.04
- 19.10
- 8.0
- 9.0
- 10.0
- 30
- 31
- 32
- 15.1
No data.
Red Hat Enterprise Linux 7
git-0:1.8.3.1-22.el7_8
Fixed · RHSA-2020:1511
Red Hat Enterprise Linux 7.7 Extended Update Support
git-0:1.8.3.1-23.el7_7
Fixed · RHSA-2020:3581
Red Hat Enterprise Linux 8
git-0:2.18.2-2.el8_1
Fixed · RHSA-2020:1513
Red Hat Enterprise Linux 8.0 Update Services for SAP Solutions
git-0:2.18.2-2.el8_0
Fixed · RHSA-2020:1518
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-git218-git-0:2.18.2-3.el7
Fixed · RHSA-2020:1503
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
rh-git218-git-0:2.18.2-3.el7
Fixed · RHSA-2020:1503
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
rh-git218-git-0:2.18.2-3.el7
Fixed · RHSA-2020:1503
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS
rh-git218-git-0:2.18.2-3.el7
Fixed · RHSA-2020:1503
Red Hat Enterprise Linux 6
git
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 7 | git-0:1.8.3.1-22.el7_8 | Fixed | RHSA-2020:1511 |
| Red Hat Enterprise Linux 7.7 Extended Update Support | git-0:1.8.3.1-23.el7_7 | Fixed | RHSA-2020:3581 |
| Red Hat Enterprise Linux 8 | git-0:2.18.2-2.el8_1 | Fixed | RHSA-2020:1513 |
| Red Hat Enterprise Linux 8.0 Update Services for SAP Solutions | git-0:2.18.2-2.el8_0 | Fixed | RHSA-2020:1518 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-git218-git-0:2.18.2-3.el7 | Fixed | RHSA-2020:1503 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS | rh-git218-git-0:2.18.2-3.el7 | Fixed | RHSA-2020:1503 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS | rh-git218-git-0:2.18.2-3.el7 | Fixed | RHSA-2020:1503 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS | rh-git218-git-0:2.18.2-3.el7 | Fixed | RHSA-2020:1503 |
| Red Hat Enterprise Linux 6 | git | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
Red Hat Enterprise Linux 6 is not affected by this flaw as the vulnerable version of git, version 1.7.9-rc0 and later, was never packaged for this instance of RHEL.
Red Hat mitigation
The most complete workaround is to disable credential helpers altogether: ~~~ git config --unset credential.helper git config --global --unset credential.helper git config --system --unset credential.helper ~~~ An alternative is to avoid malicious URLs: 1. Examine the hostname and username portion of URLs fed to git clone for the presence of encoded newlines (%0a) or evidence of credential-protocol injections (e.g., host=github.com) 2. Avoid using submodules with untrusted repositories (don't use clone --recurse-submodules; use git submodule update only after examining the URLs found in .gitmodules) 3. Avoid tools which may run git clone on untrusted URLs under the hood
References (24)
- http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00027.html vendor-advisoryx_refsource_SUSEThird Party Advisory
- http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00003.html vendor-advisoryx_refsource_SUSEThird Party Advisory
- http://packetstormsecurity.com/files/157250/Git-Credential-Helper-Protocol-Newline-Injection.html x_refsource_MISCThird Party AdvisoryVDB Entry
- http://www.openwall.com/lists/oss-security/2020/04/15/5 mailing-listx_refsource_MLISTMailing List
- http://www.openwall.com/lists/oss-security/2020/04/15/6 mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- http://www.openwall.com/lists/oss-security/2020/04/20/1 mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- https://access.redhat.com/security/cve/CVE-2020-5260 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1822020 Issue Tracking
- https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b x_refsource_MISCPatchThird Party Advisory
- https://github.com/git/git/security/advisories/GHSA-qm7j-c969-7j4q x_refsource_CONFIRMMitigationPatchThird Party Advisory
- https://lists.debian.org/debian-lts-announce/2020/04/msg00010.html mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/74Q7WVJ6FKLIN62VS2JD2XCNWK5TNKOW/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7TVS5UG6JD3MYIGSBKMIOS6AF7CR5IPI/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MOCTR2SEHCPSCOVUQJAGFPGKFMI2VE6V/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PN3FUOXKX3AXTULYV53ACABER2W2FSOU/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XPCEOIFLLEF24L6GLVJVFZX4CREDEHDF/ vendor-advisoryx_refsource_FEDORA
- https://lore.kernel.org/git/xmqqy2qy7xn8.fsf%40gitster.c.googlers.com/ x_refsource_MISC
- https://lore.kernel.org/git/xmqqy2qy7xn8.fsf@gitster.c.googlers.com/
- https://nvd.nist.gov/vuln/detail/CVE-2020-5260
- https://security.gentoo.org/glsa/202004-13 vendor-advisoryx_refsource_GENTOOThird Party Advisory
- https://support.apple.com/kb/HT211141 x_refsource_CONFIRMThird Party Advisory
- https://usn.ubuntu.com/4329-1/ vendor-advisoryx_refsource_UBUNTUThird Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2020-5260
- https://www.debian.org/security/2020/dsa-4657 vendor-advisoryx_refsource_DEBIANThird Party Advisory
Change history (0)
No recorded changes yet.