Vulnerabilities > CVE-2016-1531 - Permissions, Privileges, and Access Controls vulnerability in Exim

047910
CVSS 6.9 - MEDIUM
Attack vector
LOCAL
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
local
exim
CWE-264
nessus
exploit available
metasploit

Summary

Exim before 4.86.2, when installed setuid root, allows local users to gain privileges via the perl_startup argument.

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

  • descriptionExim < 4.86.2 - Local Root Privilege Escalation. CVE-2016-1531. Local exploit for linux platform
    fileexploits/linux/local/39549.txt
    idEDB-ID:39549
    last seen2016-03-11
    modified2016-03-10
    platformlinux
    port
    published2016-03-10
    reporterDawid Golunski
    sourcehttps://www.exploit-db.com/download/39549/
    titleExim < 4.86.2 - Local Root Privilege Escalation
    typelocal
  • descriptionExim "perl_startup" Privilege Escalation. CVE-2016-1531. Local exploit for linux platform
    fileexploits/linux/local/39702.rb
    idEDB-ID:39702
    last seen2016-04-15
    modified2016-04-15
    platformlinux
    port
    published2016-04-15
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/39702/
    titleExim "perl_startup" Privilege Escalation
    typelocal
  • descriptionexim 4.84-3 - Local Root Exploit. CVE-2016-1531. Local exploit for linux platform
    fileexploits/linux/local/39535.sh
    idEDB-ID:39535
    last seen2016-03-10
    modified2016-03-09
    platformlinux
    port
    published2016-03-09
    reporterHacker Fantastic
    sourcehttps://www.exploit-db.com/download/39535/
    titleexim <= 4.84-3 - Local Root Exploit
    typelocal

Metasploit

descriptionThis module exploits a Perl injection vulnerability in Exim < 4.86.2 given the presence of the "perl_startup" configuration parameter.
idMSF:EXPLOIT/UNIX/LOCAL/EXIM_PERL_STARTUP
last seen2020-06-01
modified2018-11-16
published2016-04-05
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/unix/local/exim_perl_startup.rb
titleExim "perl_startup" Privilege Escalation

Nessus

  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_7D09B9EEE0BA11E5ABC46FB07AF136D2.NASL
    descriptionThe Exim development team reports : All installations having Exim set-uid root and using
    last seen2020-06-01
    modified2020-06-02
    plugin id89089
    published2016-03-03
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89089
    titleFreeBSD : exim -- local privillege escalation (7d09b9ee-e0ba-11e5-abc4-6fb07af136d2)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2016-E062971917.NASL
    descriptionThis 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 seen2020-06-05
    modified2016-03-14
    plugin id89891
    published2016-03-14
    reporterThis script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89891
    titleFedora 23 : exim-4.86.2-1.fc23 (2016-e062971917)
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-2933-1.NASL
    descriptionIt 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 seen2020-06-01
    modified2020-06-02
    plugin id89962
    published2016-03-16
    reporterUbuntu Security Notice (C) 2016-2019 Canonical, Inc. / NASL script (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89962
    titleUbuntu 12.04 LTS / 14.04 LTS / 15.10 : exim4 vulnerabilities (USN-2933-1)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2017-980.NASL
    descriptionThis 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 seen2020-06-05
    modified2017-08-30
    plugin id102834
    published2017-08-30
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/102834
    titleopenSUSE Security Update : exim (openSUSE-2017-980) (Stack Clash)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2016-0E3CA94D88.NASL
    descriptionThis 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 seen2020-06-05
    modified2016-03-14
    plugin id89881
    published2016-03-14
    reporterThis script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89881
    titleFedora 22 : exim-4.85.2-1.fc22 (2016-0e3ca94d88)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2016-326.NASL
    descriptionThis update to exim 4.86.2 fixes the following issues : - CVE-2016-1531: local privilege escalation for set-uid root exim when using
    last seen2020-06-05
    modified2016-03-14
    plugin id89909
    published2016-03-14
    reporterThis script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89909
    titleopenSUSE Security Update : exim (openSUSE-2016-326)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-3517.NASL
    descriptionA local root privilege escalation vulnerability was found in Exim, Debian
    last seen2020-06-01
    modified2020-06-02
    plugin id89926
    published2016-03-15
    reporterThis script is Copyright (C) 2016-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89926
    titleDebian DSA-3517-1 : exim4 - security update

Packetstorm