Bug 1104999 (CVE-2014-3982, CVE-2014-3986)

Summary: CVE-2014-3982 CVE-2014-3986 lynis: insecure temporary file issues leading to privilege escalation
Product: [Other] Security Response Reporter: Murray McAllister <mmcallis>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: i, jrusnack
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lynis-1.5.6-1.fc20 lynis-1.5.6-1.el6 lynis-1.5.6-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-27 00:53:40 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: 1105000, 1105001    
Bug Blocks:    

Description Murray McAllister 2014-06-05 07:58:53 UTC
It was reported[1] lynis, a security auditing tool, uses a predictable filename in /tmp/. As lynis must be run as root, a local attacker could possibly use this flaw to perform a symbolic link attack and escalate their privileges to root.

The report may be referring to the following:

 39     if [ "${OS}" = "AIX" ]; then
 40         TMPFILE=/tmp/lynis.$$ 

Testing on Fedora 20 revealed /tmp/ffiYFc1nZ  was used across multiple runs; however, this name does not appear in the source and may be related to something else.

[1] http://seclists.org/fulldisclosure/2014/Jun/21

CVE request: http://www.openwall.com/lists/oss-security/2014/06/05/14

Comment 1 Murray McAllister 2014-06-05 07:59:49 UTC
Created lynis tracking bugs for this issue:

Affects: fedora-all [bug 1105000]
Affects: epel-6 [bug 1105001]

Comment 2 Murray McAllister 2014-06-05 08:00:09 UTC
Sorry for the useless bug. Filed trackers in case the maintainers know more...

Comment 3 Murray McAllister 2014-06-10 02:46:11 UTC
MITRE assigned CVE-2014-3982 to the following issue:

if [ "${OS}" = "AIX" ]; then
 TMPFILE=/tmp/lynis.$$

This should not affect Linux.

MITRE also assigned CVE-2014-3986 to the following which does affect Linux:

TMPFILE=`mktemp /tmp/lynis.XXXXXX`
...
find ${I} -name "*.conf" -print >> ${TMPFILE}.unsorted

This is the issue the original report (http://seclists.org/fulldisclosure/2014/Jun/21) refers to.

References:
http://www.openwall.com/lists/oss-security/2014/06/06/12
http://www.openwall.com/lists/oss-security/2014/06/07/3

Comment 4 Murray McAllister 2014-06-10 04:13:28 UTC
These issues were fixed upstream in version 1.5.5:

http://linux-audit.com/lynis-security-notice-154-and-older/

Comment 5 Fedora Update System 2014-06-17 23:32:14 UTC
lynis-1.5.6-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2014-07-03 17:56:30 UTC
lynis-1.5.6-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.