Bug 1109371 (CVE-2014-4038, CVE-2014-4039) - CVE-2014-4038 CVE-2014-4039 ppc64-diag: multiple temporary file races
Summary: CVE-2014-4038 CVE-2014-4039 ppc64-diag: multiple temporary file races
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2014-4038, CVE-2014-4039
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1164148 1201295
Blocks: 1109372 1121513 1193283
TreeView+ depends on / blocked
 
Reported: 2014-06-13 18:41 UTC by Vincent Danen
Modified: 2021-02-17 06:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Multiple insecure temporary file use flaws were found in the way the ppc64-diag utility created certain temporary files. A local attacker could possibly use either of these flaws to perform a symbolic link attack and overwrite arbitrary files with the privileges of the user running ppc64-diag, or obtain sensitive information from the temporary files.
Clone Of:
Environment:
Last Closed: 2015-07-22 15:25:45 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0383 0 normal SHIPPED_LIVE Moderate: ppc64-diag security, bug fix, and enhancement update 2015-03-05 14:06:12 UTC
Red Hat Product Errata RHSA-2015:1320 0 normal SHIPPED_LIVE Moderate: ppc64-diag security, bug fix and enhancement update 2015-07-20 17:53:17 UTC

Description Vincent Danen 2014-06-13 18:41:44 UTC
As noted in the SUSE bug report [1], numerous /tmp race conditions exist in ppc64-diag, in particular:

rtas_errd/diag_support.c:233:   char command[]="/usr/bin/find /proc/device-tree -name status -print > /tmp/get_dt_files";
rtas_errd/diag_support.c:241:   fp1 = fopen("/tmp/get_dt_files", "r");
rtas_errd/prrn_hotplug:8:TMPFILE=`mktemp -p /tmp`
scripts/ppc64_diag_mkrsrc:126:mkdir "/tmp/diagSEsnap", 0775;
scripts/ppc64_diag_mkrsrc:127:$general_eed_file = "/tmp/diagSEsnap/snapH.tar.gz";

In the case of rtas_errd/prrn_hotplug, mktemp is used but is assumed to have succeeded; there is no check for the return value.

mktemp should probably be used properly in all of these.  I don't know if the data in /tmp/diagSEsnap is sensitive or not, but if it is, the permissions on that directory should probably be tightened up.

No CVE(s) have been assigned to these issues as of yet.

[1] https://bugzilla.novell.com/show_bug.cgi?id=882667

Comment 1 Vincent Danen 2014-06-17 20:22:50 UTC
MITRE assigned the following CVEs to these issues:

Common Vulnerabilities and Exposures assigned an identifier CVE-2014-4038 to
the following vulnerability:

Name: CVE-2014-4038
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4038
Assigned: 20140612
Reference: http://openwall.com/lists/oss-security/2014/06/17/1
Reference: https://bugzilla.novell.com/show_bug.cgi?id=882667
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1109371

ppc64-diag 2.6.1 allows local users to overwrite arbitrary files via a
symlink attack related to (1) rtas_errd/diag_support.c and
/tmp/get_dt_files, (2) scripts/ppc64_diag_mkrsrc and
/tmp/diagSEsnap/snapH.tar.gz, or (3) lpd/test/lpd_ela_test.sh and
/var/tmp/ras.


Common Vulnerabilities and Exposures assigned an identifier CVE-2014-4039 to
the following vulnerability:

Name: CVE-2014-4039
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4039
Assigned: 20140612
Reference: http://openwall.com/lists/oss-security/2014/06/17/1
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1109371

ppc64-diag 2.6.1 uses 0775 permissions for /tmp/diagSEsnap and does
not properly restrict permissions for /tmp/diagSEsnap/snapH.tar.gz,
which allows local users to obtain sensitive information by reading
files in this archive, as demonstrated by /var/log/messages and
/etc/yaboot.conf.

Comment 2 Josh Bressers 2014-06-30 20:05:05 UTC
Statement:

(none)

Comment 4 errata-xmlrpc 2015-03-05 09:09:37 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2015:0383 https://rhn.redhat.com/errata/RHSA-2015-0383.html

Comment 6 errata-xmlrpc 2015-07-22 06:29:28 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2015:1320 https://rhn.redhat.com/errata/RHSA-2015-1320.html


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