Bug 1575466 (CVE-2018-1122)

Summary: CVE-2018-1122 procps-ng, procps: Local privilege escalation in top
Product: [Other] Security Response Reporter: Doran Moppert <dmoppert>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: albert, dmoppert, jaromir.capik, jrybar, kdudka, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: procps-ng 3.3.15 Doc Type: If docs needed, set a value
Doc Text:
If the HOME environment variable is unset or empty, top will read its configuration file from the current working directory without any security check. If a user runs top with HOME unset in an attacker-controlled directory, the attacker could achieve privilege escalation by exploiting one of several vulnerabilities in the config_file() function.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:21:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1577023, 1577024, 1579639, 1579640, 1802798, 1802799, 1805210    
Bug Blocks: 1575455    

Description Doran Moppert 2018-05-07 02:01:52 UTC
If the HOME environment variable is unset or empty, top will read its configuration file from the current working directory without any security check.  If a user runs top with HOME unset in an attacker-controlled directory, the attacker could acieve privilege escalation by exploiting one of several vulnerabilities in the config_file() function.

Comment 6 Adam Mariš 2018-05-16 11:17:05 UTC
Acknowledgments:

Name: Qualys Research Labs

Comment 7 Doran Moppert 2018-05-18 05:13:46 UTC
Public via: http://seclists.org/oss-sec/2018/q2/122

Comment 8 Doran Moppert 2018-05-18 05:13:52 UTC
External References:

https://www.qualys.com/2018/05/17/procps-ng-audit-report-advisory.txt

Comment 9 Doran Moppert 2018-05-18 05:14:16 UTC
Created procps-ng tracking bugs for this issue:

Affects: fedora-all [bug 1579639]

Comment 11 Doran Moppert 2018-12-12 02:54:13 UTC
CVSSv3 scoring has been reviewed.  Changed the AC (Attack Complexity) metric from Low to High, as exploiting this flaw relies on the target user running `top` with an unset or empty `HOME` environment variable and in a directory controlled by the attacker.  This is unusual, and certainly beyond the attacker's control.

Note that our score differs from NVD in one respect:  User Interaction: None (NVD) vs Required (Red Hat).  Exploitation requires the target user to run `top` in an attacker-controlled directory.  `top` is an interactive tool:  while it does support a batch mode that might be used from a script, the extra conditions for exploitation are extremely unlikely to be met by a script that is run unattended.  We regard plausible attack scenarios using this flaw to target a user that is interactively running `top`.

Comment 12 errata-xmlrpc 2019-08-06 12:26:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2189 https://access.redhat.com/errata/RHSA-2019:2189

Comment 15 errata-xmlrpc 2020-02-25 12:11:40 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Advanced Update Support
  Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.4 Telco Extended Update Support

Via RHSA-2020:0595 https://access.redhat.com/errata/RHSA-2020:0595

Comment 16 errata-xmlrpc 2020-04-01 08:33:03 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.5 Extended Update Support

Via RHSA-2020:1265 https://access.redhat.com/errata/RHSA-2020:1265

Comment 17 errata-xmlrpc 2020-04-14 17:40:13 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.6 Extended Update Support

Via RHSA-2020:1464 https://access.redhat.com/errata/RHSA-2020:1464