6.9
CVSSv2

CVE-2010-4345

Published: 14/12/2010 Updated: 13/02/2023
CVSS v2 Base Score: 6.9 | Impact Score: 10 | Exploitability Score: 3.4
VMScore: 805
Vector: AV:L/AC:M/Au:N/C:C/I:C/A:C

Vulnerability Summary

Exim 4.72 and previous versions allows local users to gain privileges by leveraging the ability of the exim user account to specify an alternate configuration file with a directive that contains arbitrary commands, as demonstrated by the spool_directory directive.

Vulnerable Product Search on Vulmon Subscribe to Product

exim exim 2.11

exim exim 4.70

exim exim 4.69

exim exim 4.66

exim exim 4.10

exim exim 3.16

exim exim 3.21

exim exim 3.01

exim exim 3.31

exim exim 4.24

exim exim 3.33

exim exim 3.30

exim exim

exim exim 4.30

exim exim 4.21

exim exim 4.03

exim exim 4.51

exim exim 4.71

exim exim 4.67

exim exim 4.63

exim exim 4.00

exim exim 4.43

exim exim 4.22

exim exim 3.10

exim exim 4.40

exim exim 4.52

exim exim 3.36

exim exim 3.15

exim exim 4.60

exim exim 4.61

exim exim 2.12

exim exim 4.68

exim exim 4.54

exim exim 4.02

exim exim 4.23

exim exim 4.01

exim exim 3.34

exim exim 3.00

exim exim 4.62

exim exim 3.02

exim exim 3.03

exim exim 3.12

exim exim 3.20

exim exim 4.12

exim exim 3.22

exim exim 4.32

exim exim 4.11

exim exim 4.42

exim exim 4.05

exim exim 4.31

exim exim 3.14

exim exim 3.11

exim exim 3.35

exim exim 4.44

exim exim 4.14

exim exim 4.64

exim exim 4.04

exim exim 4.41

exim exim 4.20

exim exim 2.10

exim exim 4.65

exim exim 4.53

exim exim 4.33

exim exim 3.13

exim exim 4.50

exim exim 3.32

exim exim 4.34

Vendor Advisories

Debian Bug report logs - #606527 root upgrade vulnerability in exim4 (CVE-2010-4345) Package: exim4; Maintainer for exim4 is Exim4 Maintainers <pkg-exim4-maintainers@listsaliothdebianorg>; Source for exim4 is src:exim4 (PTS, buildd, popcon) Reported by: Konrad Rosenbaum <konrad@silmorde> Date: Thu, 9 Dec 2010 22 ...
It was discovered that Exim contained a design flaw in the way it processed alternate configuration files An attacker that obtained privileges of the “Debian-exim” user could use an alternate configuration file to obtain root privileges (CVE-2010-4345) ...
A design flaw (CVE-2010-4345) in exim4 allowed the local Debian-exim user to obtain root privileges by specifying an alternate configuration file using the -C option or by using the macro override facility (-D option) Unfortunately, fixing this vulnerability is not possible without some changes in exim4's behaviour If you use the -C or -D options ...

Exploits

This Metasploit module exploits a heap buffer overflow within versions of Exim prior to version 469 By sending a specially crafted message, an attacker can corrupt the heap and execute arbitrary code with the privileges of the Exim daemon ...
## # $Id: exim4_string_formatrb 11352 2010-12-16 17:30:24Z jduck $ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions Please see the Metasploit # Framework web site for more information on licensing and terms of use # metasploitcom/framework/ ## require 'msf/core' c ...
This module exploits a heap buffer overflow within versions of Exim prior to version 469 By sending a specially crafted message, an attacker can corrupt the heap and execute arbitrary code with the privileges of the Exim daemon The root cause is that no check is made to ensure that the buffer is not full prior to ...
This module exploits a heap buffer overflow within versions of Exim prior to version 469 By sending a specially crafted message, an attacker can corrupt the heap and execute arbitrary code with the privileges of the Exim daemon The root cause is that no check is made to ensure that the buffer is not full prior to ...

Nmap Scripts

smtp-vuln-cve2010-4344

Checks for and/or exploits a heap overflow within versions of Exim prior to version 4.69 (CVE-2010-4344) and a privilege escalation vulnerability in Exim 4.72 and prior (CVE-2010-4345).

nmap --script=smtp-vuln-cve2010-4344 --script-args="smtp-vuln-cve2010-4344.exploit" -pT:25,465,587 <host>
nmap --script=smtp-vuln-cve2010-4344 --script-args="exploit.cmd='uname -a'" -pT:25,465,587 <host>

PORT STATE SERVICE 25/tcp open smtp | smtp-vuln-cve2010-4344: | Exim heap overflow vulnerability (CVE-2010-4344): | Exim (CVE-2010-4344): VULNERABLE | Shell command 'uname -a': Linux qemu-ubuntu-x32 2.6.38-8-generic #42-Ubuntu SMP Fri Jan 21 17:40:48 UTC 2011 i686 GNU/Linux | Exim privileges escalation vulnerability (CVE-2010-4345): | Exim (CVE-2010-4345): VULNERABLE | Before 'id': uid=121(Debian-exim) gid=128(Debian-exim) groups=128(Debian-exim),45(sasl) |_ After 'id': uid=0(root) gid=128(Debian-exim) groups=0(root)
smtp-vuln-cve2010-4344

Checks for and/or exploits a heap overflow within versions of Exim prior to version 4.69 (CVE-2010-4344) and a privilege escalation vulnerability in Exim 4.72 and prior (CVE-2010-4345).

nmap --script=smtp-vuln-cve2010-4344 --script-args="smtp-vuln-cve2010-4344.exploit" -pT:25,465,587 <host>
nmap --script=smtp-vuln-cve2010-4344 --script-args="exploit.cmd='uname -a'" -pT:25,465,587 <host>

PORT STATE SERVICE 25/tcp open smtp | smtp-vuln-cve2010-4344: | Exim heap overflow vulnerability (CVE-2010-4344): | Exim (CVE-2010-4344): VULNERABLE | Shell command 'uname -a': Linux qemu-ubuntu-x32 2.6.38-8-generic #42-Ubuntu SMP Fri Jan 21 17:40:48 UTC 2011 i686 GNU/Linux | Exim privileges escalation vulnerability (CVE-2010-4345): | Exim (CVE-2010-4345): VULNERABLE | Before 'id': uid=121(Debian-exim) gid=128(Debian-exim) groups=128(Debian-exim),45(sasl) |_ After 'id': uid=0(root) gid=128(Debian-exim) groups=0(root)

Metasploit Modules

Exim4 string_format Function Heap Buffer Overflow

This module exploits a heap buffer overflow within versions of Exim prior to version 4.69. By sending a specially crafted message, an attacker can corrupt the heap and execute arbitrary code with the privileges of the Exim daemon. The root cause is that no check is made to ensure that the buffer is not full prior to handling '%s' format specifiers within the 'string_vformat' function. In order to trigger this issue, we get our message rejected by sending a message that is too large. This will call into log_write to log rejection headers (which is a default configuration setting). After filling the buffer, a long header string is sent. In a successful attempt, it overwrites the ACL for the 'MAIL FROM' command. By sending a second message, the string we sent will be evaluated with 'expand_string' and arbitrary shell commands can be executed. It is likely that this issue could also be exploited using other techniques such as targeting in-band heap management structures, or perhaps even function pointers stored in the heap. However, these techniques would likely be far more platform specific, more complicated, and less reliable. This bug was original found and reported in December 2008, but was not properly handled as a security issue. Therefore, there was a 2 year lag time between when the issue was fixed and when it was discovered being exploited in the wild. At that point, the issue was assigned a CVE and began being addressed by downstream vendors. An additional vulnerability, CVE-2010-4345, was also used in the attack that led to the discovery of danger of this bug. This bug allows a local user to gain root privileges from the Exim user account. If the Perl interpreter is found on the remote system, this module will automatically exploit the secondary bug as well to get root.

msf > use exploit/unix/smtp/exim4_string_format
msf exploit(exim4_string_format) > show targets
    ...targets...
msf exploit(exim4_string_format) > set TARGET < target-id >
msf exploit(exim4_string_format) > show options
    ...show and set options...
msf exploit(exim4_string_format) > exploit
Exim4 string_format Function Heap Buffer Overflow

This module exploits a heap buffer overflow within versions of Exim prior to version 4.69. By sending a specially crafted message, an attacker can corrupt the heap and execute arbitrary code with the privileges of the Exim daemon. The root cause is that no check is made to ensure that the buffer is not full prior to handling '%s' format specifiers within the 'string_vformat' function. In order to trigger this issue, we get our message rejected by sending a message that is too large. This will call into log_write to log rejection headers (which is a default configuration setting). After filling the buffer, a long header string is sent. In a successful attempt, it overwrites the ACL for the 'MAIL FROM' command. By sending a second message, the string we sent will be evaluated with 'expand_string' and arbitrary shell commands can be executed. It is likely that this issue could also be exploited using other techniques such as targeting in-band heap management structures, or perhaps even function pointers stored in the heap. However, these techniques would likely be far more platform specific, more complicated, and less reliable. This bug was original found and reported in December 2008, but was not properly handled as a security issue. Therefore, there was a 2 year lag time between when the issue was fixed and when it was discovered being exploited in the wild. At that point, the issue was assigned a CVE and began being addressed by downstream vendors. An additional vulnerability, CVE-2010-4345, was also used in the attack that led to the discovery of danger of this bug. This bug allows a local user to gain root privileges from the Exim user account. If the Perl interpreter is found on the remote system, this module will automatically exploit the secondary bug as well to get root.

msf > use exploit/unix/smtp/exim4_string_format
msf exploit(exim4_string_format) > show targets
    ...targets...
msf exploit(exim4_string_format) > set TARGET < target-id >
msf exploit(exim4_string_format) > show options
    ...show and set options...
msf exploit(exim4_string_format) > exploit

References

CWE-264http://openwall.com/lists/oss-security/2010/12/10/1http://lists.exim.org/lurker/message/20101209.172233.abcba158.en.htmlhttps://bugzilla.redhat.com/show_bug.cgi?id=662012http://www.exim.org/lurker/message/20101207.215955.bb32d4f2.en.htmlhttp://www.theregister.co.uk/2010/12/11/exim_code_execution_peril/http://lists.exim.org/lurker/message/20101210.164935.385e04d0.en.htmlhttp://bugs.exim.org/show_bug.cgi?id=1044http://www.metasploit.com/modules/exploit/unix/smtp/exim4_string_formathttp://lists.opensuse.org/opensuse-security-announce/2010-12/msg00003.htmlhttp://www.vupen.com/english/advisories/2010/3204http://www.kb.cert.org/vuls/id/758489http://www.vupen.com/english/advisories/2010/3171http://www.debian.org/security/2010/dsa-2131http://secunia.com/advisories/42576http://www.cpanel.net/2010/12/critical-exim-security-update.htmlhttp://www.securityfocus.com/bid/45341http://www.securitytracker.com/id?1024859http://www.vupen.com/english/advisories/2011/0135http://secunia.com/advisories/42930http://www.redhat.com/support/errata/RHSA-2011-0153.htmlhttp://www.vupen.com/english/advisories/2011/0245http://secunia.com/advisories/43128http://www.debian.org/security/2011/dsa-2154http://www.ubuntu.com/usn/USN-1060-1http://secunia.com/advisories/43243http://www.vupen.com/english/advisories/2011/0364http://www.securityfocus.com/archive/1/515172/100/0/threadedhttp://www.openwall.com/lists/oss-security/2021/05/04/7https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606527https://usn.ubuntu.com/1060-1/https://nvd.nist.govhttps://www.exploit-db.com/exploits/16925/https://www.kb.cert.org/vuls/id/758489