Bug 1317981 (CVE-2016-2315, CVE-2016-2324)
Summary: | CVE-2016-2315 CVE-2016-2324 git: path_name() integer truncation and overflow leading to buffer overflow | ||
---|---|---|---|
Product: | [Other] Security Response | Reporter: | Andrej Nemec <anemec> |
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | unspecified | CC: | ago, ahardy, carl, carnil, ccoleman, chrisw, cperry, crrobins, dmcphers, dwmw2, fedora, foudilmusic, gagriogi, jaroslaw.polok, jbowes, jialiu, joelsmith, jokajak, jokerman, jorton, kent, kseifried, lmeyer, mmaslano, mmccomas, pablo.iranzo, pdwyer, pstodulk, ratlaw, sven, thomas.gerbet+redhat, tmz, unixi |
Target Milestone: | --- | Keywords: | Security |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | git 2.4.11, git 2.5.5, git 2.6.6, git 2.7.4 | Doc Type: | Bug Fix |
Doc Text: |
An integer truncation flaw and an integer overflow flaw, both leading to a heap-based buffer overflow, were found in the way Git processed certain path information. A remote attacker could create a specially crafted Git repository that would cause a Git client or server to crash or, possibly, execute arbitrary code.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-03-30 14:27:50 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1317982, 1317983, 1318220, 1318252, 1318253, 1318254, 1318255, 1318256, 1318257, 1320555, 1327084, 1329591 | ||
Bug Blocks: | 1317984 |
Description
Andrej Nemec
2016-03-15 16:49:33 UTC
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. |