CVE-2016-2315
Critical · 9.8CVSS
9.8
EPSS
17.3%
Published
Apr 8, 2016
CISA due date
—
Cloudanix analysis
A flaw in older versions of Git lets attackers who control a repository run their own programs on a developer's computer simply by getting the developer to copy files from that repository.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Incorrect integer type in revision.c leads to heap-based buffer overflow when processing long filenames or deeply nested trees, enabling remote arbitrary code execution.
Why it matters to the business
Compromised development systems and source code repositories allow attackers to inject malware, steal intellectual property, or disrupt software supply chains; high prevalence of Git across organizations amplifies exposure.
How an attack unfolds
Attacker publishes a malicious Git repository containing either an extremely long filename or many levels of nested trees; when a victim clones, fetches, or otherwise processes the repo with a vulnerable Git client, the integer mishandling in revision.c triggers the heap overflow and executes attacker-supplied code.
How to fix it
Upgrade Git to a version containing commit 34fa79a6cde56d6d428ab0d3160cb094ebad3305 (equivalent to 2.7.4 or later). Rebuild any custom packages or containers that embed the vulnerable Git binary. Remove or isolate any remaining vulnerable installations.
How to confirm the fix worked
Run 'git --version' on all systems and confirm the installed version is 2.7.4 or newer; attempt to clone a test repository containing a filename longer than 2^31 characters or a tree depth exceeding the previous integer limit and verify no crash or unexpected behavior occurs.
Typical attack path
- Create or modify a Git repository with crafted long filename or deeply nested tree objects
- Host the malicious repository on a publicly reachable server or induce the victim to add it as a remote
- Victim performs clone, fetch, or ls-remote operation against the repository
- revision.c integer mishandling causes heap overflow and attacker code execution on the victim system
How to detect it
Review Git client logs and system process crash dumps for sudden terminations or segmentation faults during clone/fetch operations; correlate with repository names containing unusually long paths or deep nesting; examine command history for unexpected Git invocations from untrusted sources.
What your security team should do
- Immediately upgrade all Git installations to the fixed commit or 2.7.4+ release
- Scan build pipelines and CI systems for embedded vulnerable Git binaries and replace them
- Add Git version checks to software bill-of-materials and dependency scanning tools
- Monitor for any post-upgrade anomalies in repository operations
The record
revision.c in git before 2.7.4 uses an incorrect integer data type, which allows remote attackers to execute arbitrary code via a (1) long filename or (2) many nested trees, leading to a heap-based buffer overflow.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | git | 0 | 1:2.7.0-1 |
| Debian:12 | git | 0 | 1:2.7.0-1 |
| Debian:13 | git | 0 | 1:2.7.0-1 |
| Debian:7 | git | 0 | 1:1.7.10.4-1+wheezy3 |
| Debian:8 | git | 0 | 1:2.1.4-2.1+deb8u2 |
| Mageia:5 | cgit | 0 | 0.12-1.2.mga5 |
| Mageia:5 | git | 0 | 2.7.4-1.mga5 |
| Red Hat:enterprise_linux:6::client | emacs-git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | emacs-git-el | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-all | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-cvs | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-daemon | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-debuginfo | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-email | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-gui | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | git-svn | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | gitk | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | gitweb | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::client | perl-Git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | emacs-git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | emacs-git-el | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-all | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-cvs | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-daemon | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-debuginfo | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-email | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-gui | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | git-svn | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | gitk | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | gitweb | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | perl-Git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | emacs-git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | emacs-git-el | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-all | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-cvs | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-daemon | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-debuginfo | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-email | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-gui | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | git-svn | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | gitk | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | gitweb | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::server | perl-Git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | emacs-git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | emacs-git-el | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-all | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-cvs | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-daemon | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-debuginfo | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-email | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-gui | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | git-svn | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | gitk | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | gitweb | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | perl-Git | 0 | 0:1.7.1-4.el6_7.1 |
| Red Hat:enterprise_linux:7::client | emacs-git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | emacs-git-el | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-all | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-bzr | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-cvs | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-daemon | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-debuginfo | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-email | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-gui | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-hg | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-p4 | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | git-svn | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | gitk | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | gitweb | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | perl-Git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::client | perl-Git-SVN | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | emacs-git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | emacs-git-el | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-all | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-bzr | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-cvs | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-daemon | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-debuginfo | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-email | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-gui | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-hg | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-p4 | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | git-svn | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | gitk | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | gitweb | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | perl-Git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::computenode | perl-Git-SVN | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | emacs-git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | emacs-git-el | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-all | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-bzr | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-cvs | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-daemon | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-debuginfo | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-email | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-gui | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-hg | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-p4 | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | git-svn | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | gitk | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | gitweb | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | perl-Git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::server | perl-Git-SVN | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | emacs-git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | emacs-git-el | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-all | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-bzr | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-cvs | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-daemon | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-debuginfo | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-email | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-gui | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-hg | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-p4 | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | git-svn | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | gitk | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | gitweb | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | perl-Git | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:enterprise_linux:7::workstation | perl-Git-SVN | 0 | 0:1.8.3.1-6.el7_2.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-emacs-git | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-emacs-git-el | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-all | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-cvs | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-daemon | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-debuginfo | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-email | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-gui | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-git-svn | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-gitk | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-gitweb | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-perl-Git | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el6 | git19-perl-Git-SVN | 0 | 0:1.9.4-4.el6.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-emacs-git | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-emacs-git-el | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-all | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-bzr | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-cvs | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-daemon | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-debuginfo | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-email | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-gui | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-hg | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-git-svn | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-gitk | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-gitweb | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-perl-Git | 0 | 0:1.9.4-4.el7.1 |
| Red Hat:rhel_software_collections:2::el7 | git19-perl-Git-SVN | 0 | 0:1.9.4-4.el7.1 |
| SUSE:Linux Enterprise Server 12 | git | 0 | 1.8.5.6-18.1 |
| SUSE:Linux Enterprise Server 12 SP1 | git | 0 | 1.8.5.6-18.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | git | 0 | 1.8.5.6-18.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | git | 0 | 1.8.5.6-18.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | git | 0 | 1.7.12.4-0.14.1 |
| SUSE:Linux Enterprise Software Development Kit 12 | git | 0 | 1.8.5.6-18.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | git | 0 | 1.8.5.6-18.1 |
| SUSE:OpenStack Cloud 5 | git | 0 | 1.7.12.4-0.14.1 |
| Ubuntu:14.04:LTS | git | 0 | 1:1.9.1-1ubuntu0.3 |
| openSUSE:Tumbleweed | cgit | 0 | 1.0-1.3 |
| openSUSE:Tumbleweed | git | 0 | 2.11.0-1.1 |
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