Bug 1695963 (CVE-2019-12439) - CVE-2019-12439 bubblewrap: temporary directory misuse as mount point
Summary: CVE-2019-12439 bubblewrap: temporary directory misuse as mount point
Status: NEW
Alias: CVE-2019-12439
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: impact=moderate,public=20190301,repor...
Keywords: Security
Depends On: 1695965 1697974 1712029 1695964
Blocks: 1695966
TreeView+ depends on / blocked
 
Reported: 2019-04-04 00:11 UTC by Pedro Sampaio
Modified: 2019-05-29 17:00 UTC (History)
21 users (show)

(edit)
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)

Description Pedro Sampaio 2019-04-04 00:11:27 UTC
Is /run/user/<UID>/.bubblewrap/ doesn't exist and couldn't be created 
(as was the case on my system), bubblewrap falls back to 
/tmp/.bubblewrap-<UID>/. Local attacker could exploit this to prevent 
other users from running bubblewrap, for example:

  getent passwd | cut -d: -f3 | xargs printf '/tmp/.bubblewrap-%d\n' | xargs touch

But it gets worse, because bubblewrap is happy to use existing 
/tmp/.bubblewrap-<UID>/, even when the directory is owned by some else. 
In the worst case, this could be exploited by a local user to execute 
arbitrary code in the container. (Though I couldn't find any way to 
exploit this without disabling protected_symlinks.)

Upstream issue:

https://github.com/projectatomic/bubblewrap/issues/304

Comment 1 Pedro Sampaio 2019-04-04 00:12:20 UTC
Created bubblewrap tracking bugs for this issue:

Affects: epel-7 [bug 1695965]
Affects: fedora-all [bug 1695964]

Comment 3 Elijah DeLee 2019-05-01 13:49:57 UTC
Github release https://github.com/projectatomic/bubblewrap/releases/tag/v0.3.3 just went out with the bugfix for https://github.com/projectatomic/bubblewrap/issues/304

RPM build is pending on bohdi now: https://bodhi.fedoraproject.org/updates/bubblewrap-0.3.3-2.el7

Comment 5 Borja Tarraso 2019-05-02 09:49:44 UTC
Statement:

Tower is not affected since systemd-logind is used by default and the UID under /run/user/ is pre-created before bubblewrap service starts.

Comment 6 Bill Nottingham 2019-05-02 15:02:53 UTC
(In reply to Borja Tarraso from comment #5)
> Statement:
> 
> Tower is not affected since systemd-logind is used by default and the UID
> under /run/user/ is pre-created before bubblewrap service starts.

This is incorrect; the system user using bubblewrap is not using a login session.

That being said, it would require local system access to try to exploit, which the vast majority of users should not have.

Comment 8 Riccardo Schirone 2019-05-20 14:57:14 UTC
Setting Attack Complexity(AC) to High(H) as for an attack to be successful fs.protected_symlinks sysctl should be 0, which is not the case by default on Red Hat Enterprise Linux.

Comment 10 Riccardo Schirone 2019-05-21 13:21:47 UTC
The attack also requires the path /run/user/<uid>/.bubblewrap to not exist, to be inaccessible or the program to fail when trying to create it. Normally, this directory either already exists or it is under the user control and it can be safely created by bubblewrap.


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