CVE-2017-8386

HIGH LAB

git <2.4.12-2.12.3 - Privilege Escalation

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 2 public exploits for CVE-2017-8386. PoCs published by hhhell, suz1n.

AI-analyzed exploit summary This repository provides a detailed technical analysis and reproduction of CVE-2017-8386, a Git-Shell sandbox bypass vulnerability. The flaw allows authenticated attackers to escape the git-shell restricted environment by exploiting the less pager's interactive command execution via `git-upload-archive --help`.

Description

git-shell in git before 2.4.12, 2.5.x before 2.5.6, 2.6.x before 2.6.7, 2.7.x before 2.7.5, 2.8.x before 2.8.5, 2.9.x before 2.9.4, 2.10.x before 2.10.3, 2.11.x before 2.11.2, and 2.12.x before 2.12.3 might allow remote authenticated users to gain privileges via a repository name that starts with a - (dash) character.

Exploits (2)

github WRITEUP
by hhhell · cpoc
https://github.com/hhhell/CVE-Vulnerability-Reproduction/tree/master/CVE-2017-8386

This repository provides a detailed technical analysis and reproduction of CVE-2017-8386, a Git-Shell sandbox bypass vulnerability. The flaw allows authenticated attackers to escape the git-shell restricted environment by exploiting the less pager's interactive command execution via `git-upload-archive --help`.

Classification
Writeup 98%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: Git versions before 2.4.12, 2.5.6, 2.6.7, 2.7.5, 2.8.5, 2.9.4, 2.10.3, 2.11.2, and 2.12.3
Auth required
Prerequisites: SSH access to a Git server with a vulnerable version · Valid SSH private key for authentication
mistral-large-3 · analyzed Jul 28, 2026 Full analysis →
nomisec WRITEUP
by suz1n · poc
https://github.com/suz1n/WHS3_vulhub

This repository provides a detailed writeup and proof-of-concept for CVE-2017-8386, a git-shell sandbox bypass vulnerability. It explains how to exploit the 'less' command within git-shell to achieve remote code execution (RCE).

Classification
Writeup 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Git-shell 2.12.2
Auth required
Prerequisites: Docker · Docker-Compose · SSH access · Git 2.12.2 · less command installed
mistral-large-3 · analyzed Feb 16, 2026 Full analysis →

References (14)

Core 14
Core References
Exploit, Third Party Advisory vendor-advisory x_refsource_ubuntu
http://www.ubuntu.com/usn/USN-3287-1
Third Party Advisory vendor-advisory x_refsource_gentoo
https://security.gentoo.org/glsa/201706-04
Mitigation, Third Party Advisory x_refsource_misc
https://insinuator.net/2017/05/git-shell-bypass-by-abusing-less-cve-2017-8386/
Third Party Advisory vdb-entry x_refsource_sectrack
http://www.securitytracker.com/id/1038479
Vendor Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2017:2491
Mailing List, Third Party Advisory vendor-advisory x_refsource_suse
http://lists.opensuse.org/opensuse-updates/2017-05/msg00090.html
Vendor Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2017:2004
Third Party Advisory, VDB Entry vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/98409
Third Party Advisory, VDB Entry vendor-advisory x_refsource_debian
http://www.debian.org/security/2017/dsa-3848

Scores

CVSS v3 8.8
EPSS 0.1239
EPSS Percentile 95.8%
Attack Vector NETWORK
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Lab Environment

COMMUNITY
Community Lab
docker pull vulhub/git:2.12.2-with-openssh

Details

Status published
Products (10)
canonical/ubuntu_linux 14.04
canonical/ubuntu_linux 16.04
canonical/ubuntu_linux 16.10
canonical/ubuntu_linux 17.04
debian/debian_linux 8.0
fedoraproject/fedora 24
fedoraproject/fedora 25
fedoraproject/fedora 26
git/git-shell
opensuse/leap 42.1
Published Jun 01, 2017
Tracked Since Feb 18, 2026