Bug 1256686 (CVE-2015-5224) - CVE-2015-5224 util-linux: File name collision due to incorrect mkstemp use
Summary: CVE-2015-5224 util-linux: File name collision due to incorrect mkstemp use
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2015-5224
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1256751
Blocks: 1256689
TreeView+ depends on / blocked
 
Reported: 2015-08-25 09:27 UTC by Adam Mariš
Modified: 2019-09-29 13:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-02 12:03:36 UTC


Attachments (Terms of Use)

Description Adam Mariš 2015-08-25 09:27:24 UTC
The following vulnerability in util-linux was announced (taken from http://seclists.org/oss-sec/2015/q3/423):

"""
If the chfn and chsh binaries (both setuid-root) from
util-linux/login-utils are compiled WITHOUT libuser support, they
eventually call mkostemp(localtmp, O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC);
where localtmp is "/etc/%s.XXXXXX" and %s is __progname (i.e., argv[0]'s
basename).

An attacker could repeatedly execve chfn as "ld.so" until mkostemp()
creates "/etc/ld.so.preload" (after a few days, in our tests).  This
particular example doesn't actually work, because "preload" is 7 chars
and "XXXXXX" is 6 chars, but it seems there are other interesting
possibilities, like "/etc/rc.status" and "/etc/krb5.keytab".

The impact of this vulnerability is probably very limited: most Linux
distributions ship either the chfn/chsh binaries from the shadow-utils
(NOT the login-utils ones), or the login-utils ones but WITH libuser
support.
"""

Upstream patch:
https://github.com/karelzak/util-linux/commit/bde91c85bdc77975155058276f99d2e0f5eab5a9

Comment 1 Adam Mariš 2015-08-25 12:02:39 UTC
Created util-linux tracking bugs for this issue:

Affects: fedora-all [bug 1256751]

Comment 2 Stefan Cornelius 2015-09-02 12:03:36 UTC
We're not affected. Our binaries do not use the mkostemp function.


Statement: 

This issue did not affect the versions of util-linux as shipped with Red Hat Enterprise Linux 5 and 7. This issue does not affect the versions of util-linux-ng as shipped with Red Hat Enterprise Linux 6.


Note You need to log in before you can comment on or make changes to this bug.