Cloudanix VulnDB

CVE-2014-9938

High · 8.8

CVSS

8.8

EPSS

2.3%

Published

Mar 20, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A problem in the way Git shows repository information in the command prompt could let a specially crafted project run unwanted commands on a user's computer.

Exploit Available
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Remote Code Execution
Component
Application
Class
Command Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw fails to sanitize branch names when constructing the PS1 shell prompt variable via git-prompt.sh, permitting command injection that results in arbitrary code execution in the user's shell.

Why it matters to the business

Developers and teams risk compromise of workstations and source code when interacting with untrusted repositories, potentially enabling data exfiltration or lateral movement; low ongoing risk given the vulnerability's age and modest exploit probability.

How an attack unfolds

An attacker publishes a repository whose branch name embeds shell metacharacters and commands; a victim clones or checks out the repository while sourcing git-prompt.sh, causing the injected payload to execute automatically when the prompt renders.

How to fix it

Upgrade affected Git installations to version 1.9.3 or later; where packages are provided through distributions, apply the corresponding fixed OpenVPN package versions listed for Debian 11/12/13 and Ubuntu 14.04/16.04.

How to confirm the fix worked

Confirm Git is at 1.9.3 or newer, test that branch names containing command substitutions no longer execute when the prompt is displayed, and verify distribution package versions match the supplied fixed releases.

Typical attack path

  1. Create a Git repository containing a branch name with embedded shell commands
  2. Social-engineer a target into cloning or fetching from the repository
  3. Trigger prompt refresh in an interactive shell that sources the vulnerable completion script
  4. Execute attacker-controlled commands with the privileges of the victim's shell session

How to detect it

Review shell history, process execution logs, and any recorded prompt expansions for unexpected command invocations immediately after Git operations; inspect cloned repository metadata for suspicious branch names.

What your security team should do

  • Prioritize patching development workstations and CI systems that use Git prompts
  • Disable or replace git-prompt.sh in high-risk environments until upgrades are complete
  • Monitor EPSS and exploit availability trends for any resurgence in interest

The record

contrib/completion/git-prompt.sh in Git before 1.9.3 does not sanitize branch names in the PS1 variable, allowing a malicious repository to cause code execution.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 git 0 1:2.0.0~rc2-1
Debian:12 git 0 1:2.0.0~rc2-1
Debian:13 git 0 1:2.0.0~rc2-1
Red Hat:enterprise_linux:7::client emacs-git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client emacs-git-el 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-all 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-bzr 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-cvs 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-daemon 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-debuginfo 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-email 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-gui 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-hg 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-p4 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client git-svn 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client gitk 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client gitweb 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client perl-Git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::client perl-Git-SVN 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode emacs-git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode emacs-git-el 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-all 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-bzr 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-cvs 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-daemon 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-debuginfo 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-email 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-gui 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-hg 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-p4 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode git-svn 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode gitk 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode gitweb 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode perl-Git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::computenode perl-Git-SVN 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server emacs-git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server emacs-git-el 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-all 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-bzr 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-cvs 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-daemon 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-debuginfo 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-email 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-gui 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-hg 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-p4 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server git-svn 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server gitk 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server gitweb 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server perl-Git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::server perl-Git-SVN 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation emacs-git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation emacs-git-el 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-all 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-bzr 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-cvs 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-daemon 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-debuginfo 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-email 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-gui 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-hg 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-p4 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation git-svn 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation gitk 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation gitweb 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation perl-Git 0 0:1.8.3.1-11.el7
Red Hat:enterprise_linux:7::workstation perl-Git-SVN 0 0:1.8.3.1-11.el7
Ubuntu:14.04:LTS git 0 1:1.9.1-1ubuntu0.4
Ubuntu:16.04:LTS git 0 1:2.7.4-0ubuntu1

Related vulnerabilities