Bug 1453074 (CVE-2017-1000367)

Summary: CVE-2017-1000367 sudo: Privilege escalation in via improper get_process_ttyname() parsing
Product: [Other] Security Response Reporter: Huzaifa S. Sidhpurwala <huzaifas>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: cdonnell, dapospis, dkopecek, jjelen, jrusnack, jvymazal, kzak, mattdm, mkolbas, pkis, rsroka, sardella, security-response-team, slawomir, wmealing
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the way sudo parsed tty information from the process status file in the proc filesystem. A local user with privileges to execute commands via sudo could use this flaw to escalate their privileges to root.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 03:13:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1455198, 1455399, 1455400, 1455401, 1455402, 1456237, 1456884    
Bug Blocks: 1449010    
Attachments:
Description Flags
sudo patch
none
proposed rhel-7.3.z patch
none
Isolated reproducer with commented out old code (copied code from sudo-1.8.6) none

Description Huzaifa S. Sidhpurwala 2017-05-22 05:54:32 UTC
A flaw was found in the way sudo read the device number of the tty from field 7 (tty_nr) from "/proc/[pid]/stat". A local attacker could use this flaw to escalate his privilege to root.

Comment 1 Huzaifa S. Sidhpurwala 2017-05-22 05:54:36 UTC
Acknowledgments:

Name: Qualys Security

Comment 6 Huzaifa S. Sidhpurwala 2017-05-25 03:40:10 UTC
Created attachment 1282109 [details]
sudo patch

Comment 9 Jakub Jelen 2017-05-25 08:29:05 UTC
Created attachment 1282148 [details]
proposed rhel-7.3.z patch

Comment 10 Jakub Jelen 2017-05-25 08:49:50 UTC
Created attachment 1282158 [details]
Isolated reproducer with commented out old code (copied code from sudo-1.8.6)

The same patch applies to rhel-6.10 and rhel-6.9.

Comment 13 Andrej Nemec 2017-05-30 15:31:20 UTC
Created sudo tracking bugs for this issue:

Affects: fedora-all [bug 1456884]

Comment 15 Andrej Nemec 2017-05-30 15:36:00 UTC
References:

http://seclists.org/oss-sec/2017/q2/358

Comment 16 errata-xmlrpc 2017-05-30 17:06:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 5 Extended Lifecycle Support

Via RHSA-2017:1381 https://access.redhat.com/errata/RHSA-2017:1381

Comment 18 errata-xmlrpc 2017-05-30 19:34:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7
  Red Hat Enterprise Linux 6

Via RHSA-2017:1382 https://access.redhat.com/errata/RHSA-2017:1382