Bug 968675 (CVE-2016-2781) - VUL-0: CVE-2016-2781: coreutils: chroot hijacking via TIOCSTI ioctl
Summary: VUL-0: CVE-2016-2781: coreutils: chroot hijacking via TIOCSTI ioctl
Status: RESOLVED WONTFIX
Alias: CVE-2016-2781
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Raymund Will
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/162307/
Whiteboard: CVSSv2:RedHat:CVE-2016-2781:6.2:(AV:L...
Keywords:
Depends on: CVE-2016-2779
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-29 12:53 UTC by Alexander Bergmann
Modified: 2018-10-04 22:55 UTC (History)
9 users (show)

See Also:
Found By: Security Response Team
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 Alexander Bergmann 2016-02-29 12:53:38 UTC
http://seclists.org/oss-sec/2016/q1/452

When executing a program via "chroot --userspec=someuser:somegroup / /path/to/test" the nonpriv session can escape to the parent session by using the TIOCSTI ioctl to push characters into the terminal's input buffer

CVE-2016-2781 was assigned to this issue.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2781
http://seclists.org/oss-sec/2016/q1/452
Comment 1 Stanislav Brabec 2016-02-29 15:49:13 UTC
Is it already known whether it is an issue of runuser or issue of chroot?
Comment 2 Stanislav Brabec 2016-03-02 19:17:20 UTC
Confirmed:

util-linux # cp -a test_tiocsti /openSUSE-root/
util-linux # chroot /openSUSE-root /test_tiocsti
id -u -n
util-linux # id -u -n
root

I see no runuser inside the strace, so chroot utility itself is affected.

Reassigning.

Please follow bug 968674 for the progress, as the attack vector is the same for all programs. The reproducer is attached there as well.
Comment 3 Stanislav Brabec 2016-03-02 19:56:43 UTC
To make the reproducer clean, I changed "id -u -n" by "ls -al /".

The inside-chroot injected command is confirmed as being called outside chroot.
Comment 4 Philipp Thomas 2016-06-03 11:07:19 UTC
According to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815922 this is best fixed by the kernel disallowing the use of TIOCSTI to unprivileged users unless the caller has CAP_SYS_ADMIN. I'm therefore reassigning this bug.
Comment 5 Marcus Meissner 2016-06-03 11:56:09 UTC
still wont help, as we have callers being root in the above chroot case.
Comment 9 Johannes Segitz 2018-09-06 11:54:57 UTC
As discussed: Since root in chroot == root on the system this is not a security issue. Given the problematic solution for other cases where this indeed is a security problem and needs to be fixed we will not put out an update for this