Vulnerabilities > CVE-2016-1531 - Permissions, Privileges, and Access Controls vulnerability in Exim
Attack vector
LOCAL Attack complexity
HIGH Privileges required
LOW Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
Exim before 4.86.2, when installed setuid root, allows local users to gain privileges via the perl_startup argument.
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 Exim < 4.86.2 - Local Root Privilege Escalation. CVE-2016-1531. Local exploit for linux platform file exploits/linux/local/39549.txt id EDB-ID:39549 last seen 2016-03-11 modified 2016-03-10 platform linux port published 2016-03-10 reporter Dawid Golunski source https://www.exploit-db.com/download/39549/ title Exim < 4.86.2 - Local Root Privilege Escalation type local description Exim "perl_startup" Privilege Escalation. CVE-2016-1531. Local exploit for linux platform file exploits/linux/local/39702.rb id EDB-ID:39702 last seen 2016-04-15 modified 2016-04-15 platform linux port published 2016-04-15 reporter metasploit source https://www.exploit-db.com/download/39702/ title Exim "perl_startup" Privilege Escalation type local description exim 4.84-3 - Local Root Exploit. CVE-2016-1531. Local exploit for linux platform file exploits/linux/local/39535.sh id EDB-ID:39535 last seen 2016-03-10 modified 2016-03-09 platform linux port published 2016-03-09 reporter Hacker Fantastic source https://www.exploit-db.com/download/39535/ title exim <= 4.84-3 - Local Root Exploit type local
Metasploit
description | This module exploits a Perl injection vulnerability in Exim < 4.86.2 given the presence of the "perl_startup" configuration parameter. |
id | MSF:EXPLOIT/UNIX/LOCAL/EXIM_PERL_STARTUP |
last seen | 2020-06-01 |
modified | 2018-11-16 |
published | 2016-04-05 |
references | |
reporter | Rapid7 |
source | https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/unix/local/exim_perl_startup.rb |
title | Exim "perl_startup" Privilege Escalation |
Nessus
NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_7D09B9EEE0BA11E5ABC46FB07AF136D2.NASL description The Exim development team reports : All installations having Exim set-uid root and using last seen 2020-06-01 modified 2020-06-02 plugin id 89089 published 2016-03-03 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/89089 title FreeBSD : exim -- local privillege escalation (7d09b9ee-e0ba-11e5-abc4-6fb07af136d2) NASL family Fedora Local Security Checks NASL id FEDORA_2016-E062971917.NASL description This is new version fixing local privilege escalation for set-uid root when using perl_startup. 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-14 plugin id 89891 published 2016-03-14 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/89891 title Fedora 23 : exim-4.86.2-1.fc23 (2016-e062971917) NASL family Ubuntu Local Security Checks NASL id UBUNTU_USN-2933-1.NASL description It was discovered that Exim incorrectly filtered environment variables when used with the perl_startup configuration option. If the perl_startup option was enabled, a local attacker could use this issue to escalate their privileges to the root user. This issue has been fixed by having Exim clean the complete execution environment by default on startup, including any subprocesses such as transports that call other programs. This change in behaviour may break existing installations and can be adjusted by using two new configuration options, keep_environment and add_environment. (CVE-2016-1531) Patrick William discovered that Exim incorrectly expanded mathematical comparisons twice. A local attacker could possibly use this issue to perform arbitrary file operations as the Exim user. This issue only affected Ubuntu 12.04 LTS and Ubuntu 14.04 LTS. (CVE-2014-2972). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 89962 published 2016-03-16 reporter Ubuntu Security Notice (C) 2016-2019 Canonical, Inc. / NASL script (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/89962 title Ubuntu 12.04 LTS / 14.04 LTS / 15.10 : exim4 vulnerabilities (USN-2933-1) NASL family SuSE Local Security Checks NASL id OPENSUSE-2017-980.NASL description This update for exim fixes the following issues : Changes in exim : - specify users with ref:mail, to make them dynamic. (boo#1046971) - CVE-2017-1000369: Fixed memory leaks that could be exploited to last seen 2020-06-05 modified 2017-08-30 plugin id 102834 published 2017-08-30 reporter This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/102834 title openSUSE Security Update : exim (openSUSE-2017-980) (Stack Clash) NASL family Fedora Local Security Checks NASL id FEDORA_2016-0E3CA94D88.NASL description This is new version fixing local privilege escalation for set-uid root when using perl_startup. 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-14 plugin id 89881 published 2016-03-14 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/89881 title Fedora 22 : exim-4.85.2-1.fc22 (2016-0e3ca94d88) NASL family SuSE Local Security Checks NASL id OPENSUSE-2016-326.NASL description This update to exim 4.86.2 fixes the following issues : - CVE-2016-1531: local privilege escalation for set-uid root exim when using last seen 2020-06-05 modified 2016-03-14 plugin id 89909 published 2016-03-14 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/89909 title openSUSE Security Update : exim (openSUSE-2016-326) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-3517.NASL description A local root privilege escalation vulnerability was found in Exim, Debian last seen 2020-06-01 modified 2020-06-02 plugin id 89926 published 2016-03-15 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/89926 title Debian DSA-3517-1 : exim4 - security update
Packetstorm
data source https://packetstormsecurity.com/files/download/136694/exim_perl_startup.rb.txt id PACKETSTORM:136694 last seen 2016-12-05 published 2016-04-14 reporter Dawid Golunski source https://packetstormsecurity.com/files/136694/Exim-perl_startup-Privilege-Escalation.html title Exim perl_startup Privilege Escalation data source https://packetstormsecurity.com/files/download/136165/Exim-Local-Root-Privilege-Escalation.txt id PACKETSTORM:136165 last seen 2016-12-05 published 2016-03-10 reporter Dawid Golunski source https://packetstormsecurity.com/files/136165/Exim-Local-Privilege-Escalation.html title Exim Local Privilege Escalation data source https://packetstormsecurity.com/files/download/136124/exim-escalate.txt id PACKETSTORM:136124 last seen 2016-12-05 published 2016-03-08 reporter Hacker Fantastic source https://packetstormsecurity.com/files/136124/Exim-4.84-3-Local-Root-Privilege-Escalation.html title Exim 4.84-3 Local Root / Privilege Escalation
References
- https://www.exploit-db.com/exploits/39535/
- http://packetstormsecurity.com/files/136124/Exim-4.84-3-Local-Root-Privilege-Escalation.html
- http://www.exim.org/static/doc/CVE-2016-1531.txt
- http://lists.opensuse.org/opensuse-security-announce/2016-03/msg00026.html
- http://www.debian.org/security/2016/dsa-3517
- http://www.rapid7.com/db/modules/exploit/unix/local/exim_perl_startup
- http://www.ubuntu.com/usn/USN-2933-1
- http://www.securitytracker.com/id/1035512
- https://www.exploit-db.com/exploits/39702/
- https://www.exploit-db.com/exploits/39549/