CVE-2014-9938
git: git-prompt.sh does not sanitize branch names in $PS1
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
1Exploited in Wild
-Decision
Descriptions
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.
Contrib/completion/git-prompt.sh en Git en versiones anteriores a 1.9.3 no desinfecta nombres de sucursales en la variable PS1, permitiendo que un repositorio malicioso cause la ejecución de código.
It was found that the git-prompt.sh script shipped with git failed to correctly handle branch names containing special characters. A specially crafted git repository could use this flaw to execute arbitrary commands if a user working with the repository configured their shell to include repository information in the prompt.
Git is a distributed revision control system with a decentralized architecture. As opposed to centralized version control systems with a client-server model, Git ensures that each working copy of a Git repository is an exact copy with complete revision history. This not only allows the user to work on and contribute to projects without the need to have permission to push the changes to their official repositories, but also makes it possible for the user to work with no network connection. Security Fix: It was found that the git-prompt.sh script shipped with git failed to correctly handle branch names containing special characters. A specially crafted git repository could use this flaw to execute arbitrary commands if a user working with the repository configured their shell to include repository information in the prompt.
CVSS Scores
SSVC
- Decision:-
Timeline
- 2017-03-19 CVE Reserved
- 2017-03-20 CVE Published
- 2024-08-06 CVE Updated
- 2024-08-06 First Exploit
- 2025-03-30 EPSS Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
CWE
- CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
- CWE-116: Improper Encoding or Escaping of Output
CAPEC
References (5)
URL | Tag | Source |
---|
URL | Date | SRC |
---|---|---|
https://github.com/njhartwell/pw3nage | 2024-08-06 |
URL | Date | SRC |
---|---|---|
https://github.com/git/git/commit/8976500cbbb13270398d3b3e07a17b8cc7bff43f | 2020-04-29 |
URL | Date | SRC |
---|---|---|
https://access.redhat.com/errata/RHSA-2017:2004 | 2020-04-29 | |
https://access.redhat.com/security/cve/CVE-2014-9938 | 2017-08-01 | |
https://bugzilla.redhat.com/show_bug.cgi?id=1434415 | 2017-08-01 |