CVE-2014-9938
High · 8.8CVSS
8.8
EPSS
2.3%
Published
Mar 20, 2017
CISA due date
—
Cloudanix analysis
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.
- 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
- Create a Git repository containing a branch name with embedded shell commands
- Social-engineer a target into cloning or fetching from the repository
- Trigger prompt refresh in an interactive shell that sources the vulnerable completion script
- 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
- CVE-2025-48384 Git is a fast, scalable, distributed revision control system with an unusually rich… Also affects git
- CVE-2024-52005 Git is a source code management tool. Also affects git
- CVE-2024-52006 Git is a fast, scalable, distributed revision control system with an unusually rich… Also affects git
- CVE-2024-50349 Git is a fast, scalable, distributed revision control system with an unusually rich… Also affects git
- CVE-2014-9390 Git before 1.8.5.6, 1.9.x before 1.9.5, 2.0.x before 2.0.5, 2.1.x before 2.1.4, and 2.2.x… Also affects git
- CVE-2017-15298 Git through 2.14.2 mishandles layers of tree objects, which allows remote attackers to… Also affects git
- CVE-2017-1000117 A malicious third-party can give a crafted "ssh://..." URL to an unsuspecting victim, and… Also affects git
- CVE-2017-14867 Git before 2.10.5, 2.11.x before 2.11.4, 2.12.x before 2.12.5, 2.13.x before 2.13.6, and… Also affects git