Vulnerabilities > CVE-2015-5602 - Permissions, Privileges, and Access Controls vulnerability in Sudo Project Sudo
Attack vector
UNKNOWN Attack complexity
UNKNOWN Privileges required
UNKNOWN Confidentiality impact
UNKNOWN Integrity impact
UNKNOWN Availability impact
UNKNOWN Summary
sudoedit in Sudo before 1.8.15 allows local users to gain privileges via a symlink attack on a file whose full path is defined using multiple wildcards in /etc/sudoers, as demonstrated by "/home/*/*/file.txt."
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Accessing, Modifying or Executing Executable Files An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
- Leverage Executable Code in Non-Executable Files An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
- Blue Boxing This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
- Restful Privilege Elevation Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
- Target Programs with Elevated Privileges This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.
Exploit-Db
description | Sudo <= 1.8.14 - Unauthorized Privilege. CVE-2015-5602. Local exploit for linux platform |
file | exploits/linux/local/37710.txt |
id | EDB-ID:37710 |
last seen | 2016-02-04 |
modified | 2015-07-28 |
platform | linux |
port | |
published | 2015-07-28 |
reporter | daniel svartman |
source | https://www.exploit-db.com/download/37710/ |
title | Sudo <= 1.8.14 - Unauthorized Privilege |
type | local |
Nessus
NASL family Debian Local Security Checks NASL id DEBIAN_DLA-382.NASL description When sudo is configured to allow a user to edit files under a directory that they can already write to without using sudo, they can actually edit (read and write) arbitrary files. Daniel Svartman reported that a configuration like this might be introduced unintentionally if the editable files are specified using wildcards, for example : operator ALL=(root) sudoedit /home/*/*/test.txt The default behaviour of sudo has been changed so that it does not allow editing of a file in a directory that the user can write to, or that is reached by following a symlink in a directory that the user can write to. These restrictions can be disabled, but this is strongly discouraged. For the oldoldstable distribution (squeeze), this has been fixed in version 1.7.4p4-2.squeeze.6. For the oldstable distribution (wheezy) and the stable distribution (jessie), this will be fixed soon. NOTE: Tenable Network Security has extracted the preceding description block directly from the DLA security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-03-17 modified 2016-01-11 plugin id 87826 published 2016-01-11 reporter This script is Copyright (C) 2016-2020 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/87826 title Debian DLA-382-1 : sudo security update code #%NASL_MIN_LEVEL 80502 # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Debian Security Advisory DLA-382-1. The text # itself is copyright (C) Software in the Public Interest, Inc. # include("compat.inc"); if (description) { script_id(87826); script_version("2.3"); script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/12"); script_cve_id("CVE-2015-5602"); script_name(english:"Debian DLA-382-1 : sudo security update"); script_summary(english:"Checks dpkg output for the updated packages."); script_set_attribute( attribute:"synopsis", value:"The remote Debian host is missing a security update." ); script_set_attribute( attribute:"description", value: "When sudo is configured to allow a user to edit files under a directory that they can already write to without using sudo, they can actually edit (read and write) arbitrary files. Daniel Svartman reported that a configuration like this might be introduced unintentionally if the editable files are specified using wildcards, for example : operator ALL=(root) sudoedit /home/*/*/test.txt The default behaviour of sudo has been changed so that it does not allow editing of a file in a directory that the user can write to, or that is reached by following a symlink in a directory that the user can write to. These restrictions can be disabled, but this is strongly discouraged. For the oldoldstable distribution (squeeze), this has been fixed in version 1.7.4p4-2.squeeze.6. For the oldstable distribution (wheezy) and the stable distribution (jessie), this will be fixed soon. NOTE: Tenable Network Security has extracted the preceding description block directly from the DLA security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues." ); script_set_attribute( attribute:"see_also", value:"https://lists.debian.org/debian-lts-announce/2016/01/msg00005.html" ); script_set_attribute( attribute:"see_also", value:"https://packages.debian.org/source/squeeze-lts/sudo" ); script_set_attribute( attribute:"solution", value:"Upgrade the affected sudo, and sudo-ldap packages." ); script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:C/I:C/A:C"); script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C"); script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available"); script_set_attribute(attribute:"exploit_available", value:"true"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:sudo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:sudo-ldap"); script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:6.0"); script_set_attribute(attribute:"patch_publication_date", value:"2016/01/10"); script_set_attribute(attribute:"plugin_publication_date", value:"2016/01/11"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2016-2020 Tenable Network Security, Inc."); script_family(english:"Debian Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l"); exit(0); } include("audit.inc"); include("debian_package.inc"); if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED); if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian"); if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING); flag = 0; if (deb_check(release:"6.0", prefix:"sudo", reference:"1.7.4p4-2.squeeze.6")) flag++; if (deb_check(release:"6.0", prefix:"sudo-ldap", reference:"1.7.4p4-2.squeeze.6")) flag++; if (flag) { if (report_verbosity > 0) security_hole(port:0, extra:deb_report_get()); else security_hole(0); exit(0); } else audit(AUDIT_HOST_NOT, "affected");
NASL family Debian Local Security Checks NASL id DEBIAN_DSA-3440.NASL description When sudo is configured to allow a user to edit files under a directory that they can already write to without using sudo, they can actually edit (read and write) arbitrary files. Daniel Svartman reported that a configuration like this might be introduced unintentionally if the editable files are specified using wildcards, for example : operator ALL=(root) sudoedit /home/*/*/test.txt The default behaviour of sudo has been changed so that it does not allow editing of a file in a directory that the user can write to, or that is reached by following a symlink in a directory that the user can write to. These restrictions can be disabled, but this is strongly discouraged. last seen 2020-06-01 modified 2020-06-02 plugin id 87852 published 2016-01-12 reporter This script is Copyright (C) 2016-2018 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/87852 title Debian DSA-3440-1 : sudo - security update NASL family Fedora Local Security Checks NASL id FEDORA_2015-6A267387C0.NASL description sudo-1.8.15-1.fc21 - update to 1.8.15 - fixes CVE-2015-5602 sudo-1.8.15-1.fc22 - update to 1.8.15 - fixes CVE-2015-5602 sudo-1.8.15-1.fc23 - update to 1.8.15 - fixes CVE-2015-5602 Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-05 modified 2016-03-04 plugin id 89266 published 2016-03-04 reporter This script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/89266 title Fedora 22 : sudo-1.8.15-1.fc22 (2015-6a267387c0) NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_2E8CDD36C3CC11E5B5FE002590263BF5.NASL description MITRE reports : sudoedit in Sudo before 1.8.15 allows local users to gain privileges via a symlink attack on a file whose full path is defined using multiple wildcards in /etc/sudoers, as demonstrated by last seen 2020-06-01 modified 2020-06-02 plugin id 88149 published 2016-01-26 reporter This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/88149 title FreeBSD : sudo -- potential privilege escalation via symlink misconfiguration (2e8cdd36-c3cc-11e5-b5fe-002590263bf5) NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-201606-13.NASL description The remote host is affected by the vulnerability described in GLSA-201606-13 (sudo: Unauthorized privilege escalation in sudoedit) sudoedit in sudo is vulnerable to the escalation of privileges by local users via a symlink attack. This can be exploited by a file whose full path is defined using multiple wildcards in “/etc/sudoers”, as demonstrated by “/home/*/*/file.txt”. Impact : Local users are able to gain unauthorized privileges on the system. Workaround : There is no known work around at this time. last seen 2020-06-01 modified 2020-06-02 plugin id 91844 published 2016-06-27 reporter This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/91844 title GLSA-201606-13 : sudo: Unauthorized privilege escalation in sudoedit NASL family Fedora Local Security Checks NASL id FEDORA_2015-386863DF8A.NASL description sudo-1.8.15-1.fc21 - update to 1.8.15 - fixes CVE-2015-5602 sudo-1.8.15-1.fc22 - update to 1.8.15 - fixes CVE-2015-5602 sudo-1.8.15-1.fc23 - update to 1.8.15 - fixes CVE-2015-5602 Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-05 modified 2016-03-04 plugin id 89210 published 2016-03-04 reporter This script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/89210 title Fedora 23 : sudo-1.8.15-1.fc23 (2015-386863df8a)
Seebug
bulletinFamily | exploit |
description | <p># Exploit Title: sudo -e - a.k.a. sudoedit - unauthorized privilege escalation</p><p># Date: 07-23-2015</p><p># Exploit Author: Daniel Svartman</p><p># Version: Sudo <=1.8.14</p><p># Tested on: RHEL 5/6/7 and Ubuntu (all versions)</p><p># CVE: CVE-2015-5602.</p><p> </p><p>Hello,</p><p> </p><p>I found a security bug in sudo (checked in the latest versions of sudo</p><p>running on RHEL and ubuntu) when a user is granted with root access to</p><p>modify a particular file that could be located in a subset of directories.</p><p> </p><p>It seems that sudoedit does not check the full path if a wildcard is used</p><p>twice (e.g. /home/*/*/file.txt), allowing a malicious user to replace the</p><p>file.txt real file with a symbolic link to a different location (e.g.</p><p>/etc/shadow).</p><p> </p><p>I was able to perform such redirect and retrieve the data from the</p><p>/etc/shadow file.</p><p> </p><p>I checked this against fixed directories and files (not using a wildcard)</p><p>and it does work with symbolic links created under the /home folder.</p> <p> In order for you to replicate this, you should configure the following line <p> in your /etc/sudoers file: </p><p> <user_to_grant_priv> ALL=(root) NOPASSWD: sudoedit /home/*/*/test.txt </p><p> Then, logged as that user, create a subdirectory within its home folder </p><p> (e.g. /home/<user_to_grant_priv>/newdir) and later create a symbolic link inside the new folder named test.txt pointing to /etc/shadow. </p><p> When you run sudoedit /home/<user_to_grant_priv>/newdir/test.txt you will </p><p> be allowed to access the /etc/shadow even if have not been granted with </p><p> such access in the sudoers file.</p> |
id | SSV:89279 |
last seen | 2017-11-19 |
modified | 2015-09-01 |
published | 2015-09-01 |
title | Sudo <= 1.8.14 - Unauthorized Privilege |
References
- http://lists.fedoraproject.org/pipermail/package-announce/2015-November/171024.html
- http://www.sudo.ws/stable.html#1.8.15
- http://bugzilla.sudo.ws/show_bug.cgi?id=707
- http://lists.fedoraproject.org/pipermail/package-announce/2015-November/171054.html
- https://www.exploit-db.com/exploits/37710/
- https://security.gentoo.org/glsa/201606-13
- http://www.oracle.com/technetwork/topics/security/bulletinapr2016-2952098.html
- http://www.debian.org/security/2016/dsa-3440
- http://www.securitytracker.com/id/1034392