Bug 1409531 - (CVE-2016-9962) CVE-2016-9962 docker: insecure opening of file-descriptor allows privilege escalation
CVE-2016-9962 docker: insecure opening of file-descriptor allows privilege es...
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Trevor Jay
impact=moderate,public=20170111,repor...
: Security
Depends On: 1409705 1409708 1412237 1412238 1412239 1409706 1409707 1412147 1412189
Blocks: 1409535
  Show dependency treegraph
 
Reported: 2017-01-02 07:23 EST by Martin Prpic
Modified: 2017-01-18 03:17 EST (History)
28 users (show)

See Also:
Fixed In Version: docker 1.12.6
Doc Type: Bug Fix
Doc Text:
The runc component used by `docker exec` feature of docker allowed additional container processes to be ptraced by the pid 1 of the container. This allows the main processes of the container, if running as root, to gain low-level access to these new processes during initialization. An attacker can, depending on the nature of the incoming process, leverage this to elevate access to the host. This ranges from accessing host content through the file descriptors of the incoming process to, potentially, a complete container escape by leveraging memory access or syscall interception.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 03:17:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
CVE-2016-9962 patch (12.80 KB, text/plain)
2017-01-02 07:32 EST, Martin Prpic
no flags Details

  None (edit)
Description Martin Prpic 2017-01-02 07:23:40 EST
The following issue was reported in Docker:

RunC allowed additional container processes via `runc exec` to be ptraced by the pid 1 of the container.  This allows the main processes of the container, if running as root, to gain access to file-descriptors of these new processes during the initialization and can lead to container escapes or modification of runC state before the process is fully placed inside the container.
Comment 1 Martin Prpic 2017-01-02 07:23:52 EST
Acknowledgments:

Name: the Docker project
Upstream: Aleksa Sarai (SUSE), Tõnis Tiigi (Docker)
Comment 2 Martin Prpic 2017-01-02 07:32 EST
Created attachment 1236624 [details]
CVE-2016-9962 patch
Comment 8 Trevor Jay 2017-01-03 13:35:43 EST
This is an extremely difficult to exploit flaw on standard RHEL and Fedora systems. 

I checked the 1.10.3 and 1.12.5 builds on Brew. Both drop the `CAP_SYS_PTRACE` capability by default. 1.10.3 blacklists `ptrace` calls under the default seccomp profile. Thus, this flaw only comes into play for containers that already have elevated privileges. 

Even if `ptrace` is available. The proposed exploit scenario of quickly attaching to a process joining the container space and using its file descriptors is *not* possible under the default SELinux configuration. The containerized PID 1 will have a type of `container_t` or similar SELinux type and thus will be blocked by standard type enforcement from accessing accessing any resources that haven't already been made available to containerized processes.
Comment 12 Andrej Nemec 2017-01-11 03:58:12 EST
Public via:

http://seclists.org/oss-sec/2017/q1/54
Comment 13 Trevor Jay 2017-01-11 10:27:11 EST
Created runc tracking bugs for this issue:

Affects: fedora-all [bug 1412238]
Comment 15 Vincent Danen 2017-01-11 16:34:32 EST
External References:

https://access.redhat.com/security/vulnerabilities/cve-2016-9962
Comment 16 errata-xmlrpc 2017-01-17 15:45:29 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7 Extras

Via RHSA-2017:0116 https://rhn.redhat.com/errata/RHSA-2017-0116.html
Comment 17 errata-xmlrpc 2017-01-17 15:47:16 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7 Extras

Via RHSA-2017:0123 https://rhn.redhat.com/errata/RHSA-2017-0123.html
Comment 18 errata-xmlrpc 2017-01-17 15:48:01 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7 Extras

Via RHSA-2017:0127 https://rhn.redhat.com/errata/RHSA-2017-0127.html

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