There is a buffer overflow vulnerability possibly leading to remote code execution in git. It can happen while pushing or cloning a repository with a large filename or a large number of nested trees. References: http://seclists.org/oss-sec/2016/q1/645 Parts of the original report: http://pastebin.com/UX2P2jjg CVE assignement notes: http://seclists.org/oss-sec/2016/q1/653
Created git tracking bugs for this issue: Affects: epel-5 [bug 1317982]
Isn't Fedora 23 and Fedora 22 also affected? They both have git versions below 2.7.1.
(In reply to Christian Stadelmann from comment #4) > Isn't Fedora 23 and Fedora 22 also affected? They both have git versions > below 2.7.1. Hi, you might be right, I will change it to affected and let the Fedora guys look at this. Thanks for the heads up. My mistake might have originated by looking at this http://koji.fedoraproject.org/koji/packageinfo?packageID=1864
Created git tracking bugs for this issue: Affects: fedora-all [bug 1318220]
Statement: Red Hat Product Security has rated these issues as having Important security impact. For additional information, refer to the Red Hat Knowledgebase article: https://access.redhat.com/articles/2201201
I'd suggest to change the "Fixed in version" field because it is not fixed in 2.7.1. Actually the fix does not reside in any upstream release. http://www.openwall.com/lists/oss-security/2016/03/16/9
It does now (in v2.4.11, v2.5.5, v2.6.6 and v2.7.4): http://marc.info/?l=git&m=145824889421350
git-2.5.5-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Both CVE-2016-2315 and CVE-2016-2324 affect the same function, "path_name" in revision.c: > 20 char *path_name(const struct name_path *path, const char *name) > 21 { > 22 const struct name_path *p; > 23 char *n, *m; > 24 int nlen = strlen(name); > 25 int len = nlen + 1; > 26 > 27 for (p = path; p; p = p->up) { > 28 if (p->elem_len) > 29 len += p->elem_len + 1; > 30 } > 31 n = xmalloc(len); > 32 m = n + len - (nlen + 1); > 33 strcpy(m, name); > 34 for (p = path; p; p = p->up) { > 35 if (p->elem_len) { > 36 m -= p->elem_len + 1; > 37 memcpy(m, p->elem, p->elem_len); > 38 m[p->elem_len] = '/'; > 39 } > 40 } > 41 return n; > 42 } CVE-2016-2315 has been assigned to the fact that the "int" datatype is used for the "nlen" length/size value (line 24). The problem is that "int" is a signed datatype and in case of an integer overflow the value could wrap around into a negative value. Additionally, on 64bit this could lead to an unexpected integer truncation, as "int" may be smaller than, for example, "size_t". The same applies to the "len" size value (line 25). CVE-2016-2324 has been assigned to the integer overflow in the loop in lines 27 to 30. If path elements of sufficient length are added to "len", len could overflow and wrap around into a negative value. It's possible to attack both client and server setups by creating a specially crafted packfile (an internal Git data format used to efficiently exchange repository information) and then providing said packfile to a vulnerable Git setup. In order to launch an attack against servers, the attacker needs to be able to push data to one of the server's repositories, which generally requires successful authentication. In order to attack a client, an attacker would have to trick an unsuspecting Git user into cloning from a malicious Git repository. When exploited, the issues can result in a memory corruption, which most likely crashes the Git application. However, it can't be ruled out that a successful exploitation attempt may result in the execution of arbitrary code.
This issue has been addressed in the following products: Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS Red Hat Software Collections for Red Hat Enterprise Linux 6 Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7 Via RHSA-2016:0497 https://rhn.redhat.com/errata/RHSA-2016-0497.html
This issue has been addressed in the following products: Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Via RHSA-2016:0496 https://rhn.redhat.com/errata/RHSA-2016-0496.html
git-2.4.11-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
git-1.8.2.3-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.