Bug 935338 (CVE-2015-0794) - VUL-0: CVE-2015-0794: dracut: uses hardcoded /tmp/dracut_block_uuid.map filename - symlink attack
Summary: VUL-0: CVE-2015-0794: dracut: uses hardcoded /tmp/dracut_block_uuid.map filen...
Status: RESOLVED FIXED
Alias: CVE-2015-0794
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Thomas Renninger
QA Contact: Security Team bot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-18 23:41 UTC by Christian Boltz
Modified: 2021-03-02 16:44 UTC (History)
6 users (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Boltz 2015-06-18 23:41:07 UTC
dracut uses /tmp/dracut_block_uuid.map as hardcoded filename.

This allows symlink attacks. An attacker (local non-root user) can create /tmp/dracut_block_uuid.map as symlink pointing to any file, and that file will be destroyed/overwritten when mkinitrd runs the next time.
Comment 1 Marcus Meissner 2015-06-19 06:37:21 UTC
in /usr/lib/dracut/modules.d/90crypt/module-setup.sh
Comment 2 Marcus Meissner 2015-06-19 06:39:26 UTC
is in SUSE specific patch:

commit 7f4dea242398cc369ff3fecd599faa00d81a522c
Author: Julian Wolf <juwolf@suse.de>
Date:   Tue Aug 19 16:23:59 2014 +0200

    90crypt: Fixed crypttab_contains() to also work with device path in /etc/crypttab
    
    blkid is not available when this function is called, so block_uuid.map is put into
    the initrd, mapping block devices from /etc/crypttab to UUIDs.
    
    This fixes a bug where udev rules were created by mistake as crypttab_contains()
    returned false for devices specified by path in /etc/crypttab which resulted in
    error messages during boot.
    
    Signed-off-by: Julian Wolf <juwolf@suse.de>
Comment 3 Marcus Meissner 2015-06-19 06:52:03 UTC
Assigned CVE-2015-0794 from SUSE CVE Pool.
Comment 4 Christian Boltz 2015-06-19 11:54:19 UTC
Don't (only) blame Julian - instead, sit down (important safety measure!) and
    grep -r /tmp /usr/lib/dracut/modules.d/

This brings up lots of hardcoded filenames in /tmp. Besides allowing more symlink attacks, I even found examples that might allow attackers to get code executed as root (". /tmp/bridge.info") :-/

To get only the code execution listed,
    grep -r '\. /tmp' /usr/lib/dracut/modules.d/
Comment 5 Swamp Workflow Management 2015-06-19 22:00:19 UTC
bugbot adjusting priority
Comment 6 Marcus Meissner 2015-10-13 09:25:17 UTC
is this fixed in the current dracut submission for SLE12? please submit if not.
Comment 7 Thomas Renninger 2015-10-13 11:51:00 UTC
/tmp/bridge.info is in the initrd. You cannot open the initrd and create links in the /tmp directory of the initrd as normal user. So this needs no fixing, but is correct.

/tmp/dracut_block_uuid.map needs adjusting, though.
Comment 8 Fabian Vogt 2015-11-10 10:12:23 UTC
There's also a similiar issue, introduced by 0169-Enabled-Warning-for-failed-kernel-modules-per-defaul.patch with /tmp/dracut_failed_drivers:

 From dbcb0516d9c3270138849f444f40237d1b14797e Mon Sep 17 00:00:00 2001
 From: Julian Wolf <juwolf@suse.de>
 Date: Fri, 24 Oct 2014 17:07:07 +0200
 Subject: Enable warning for failed kernel moduiles

 Enabled Warning for failed kernel modules per default
 and added summary of those to the end of dracut output

 References: bnc#886839

I fixed those issued by converting the fixed names to mktemp generated ones, fix is currently being prepared for SLE, 13.2 and Factory.
Comment 9 Bernhard Wiedemann 2015-11-10 12:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (935338) was mentioned in
https://build.opensuse.org/request/show/343394 13.2 / dracut
Comment 10 Bernhard Wiedemann 2015-11-10 16:00:25 UTC
This is an autogenerated message for OBS integration:
This bug (935338) was mentioned in
https://build.opensuse.org/request/show/343477 13.2 / dracut
Comment 11 Swamp Workflow Management 2015-11-18 13:16:00 UTC
openSUSE-SU-2015:2022-1: An update that solves one vulnerability and has two fixes is now available.

Category: security (moderate)
Bug References: 935338,935993,952491
CVE References: CVE-2015-0794
Sources used:
openSUSE 13.2 (src):    dracut-037-17.30.1
Comment 12 Bernhard Wiedemann 2015-11-19 18:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (935338) was mentioned in
https://build.opensuse.org/request/show/345214 Leap:42.1 / dracut
Comment 13 Swamp Workflow Management 2015-11-20 17:10:28 UTC
SUSE-SU-2015:2065-1: An update that solves one vulnerability and has three fixes is now available.

Category: security (moderate)
Bug References: 935338,935993,947518,952491
CVE References: CVE-2015-0794
Sources used:
SUSE Linux Enterprise Server 12 (src):    dracut-037-51.17.3
SUSE Linux Enterprise Desktop 12 (src):    dracut-037-51.17.3
Comment 14 Thomas Renninger 2015-11-27 10:00:26 UTC
Fixes available for some days already, see above.
Comment 15 Swamp Workflow Management 2015-12-02 02:10:38 UTC
openSUSE-SU-2015:2165-1: An update that contains security fixes can now be installed.

Category: security (moderate)
Bug References: 935338,935563,952491,953035,953361
CVE References: 
Sources used:
openSUSE Leap 42.1 (src):    dracut-037-68.1