exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

exim-spamd-overflow.txt

exim-spamd-overflow.txt
Posted May 15, 2007
Authored by calcite

spamd as included with Exim version 4.66 suffers from a buffer overflow vulnerability.

tags | advisory, overflow
SHA-256 | 4b0f98d331b7749c0d64a655240d9befac04d5f48f9211580eb945a6b6df053f

exim-spamd-overflow.txt

Change Mirror Download
Exim in conjuction with spamd messup 
By calcite@setec.org

"Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet. It is freely available under the terms of the GNU General Public Licence. In style it is similar to Smail 3, but its facilities are more general. There is a great deal of flexibility in the way mail can be routed, and there are extensive facilities for checking incoming mail. Exim can be installed in place of sendmail, although the configuration of exim is quite different to that of sendmail. "

There are bugs in exim "spam.c" source file for handling communication with apaches spamd daemon to help filter spam messages.

----Exim 4.66 Source spam.c--------
.......
int spamd_report_offset;
..................
uschar spamd_version[8];

------------ The messup------------
if( sscanf(CS spamd_buffer,"SPAMD/%s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n",
spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) {

/* try to fall back to pre-2.50 spamd output */
if( sscanf(CS spamd_buffer,"SPAMD/%s 0 EX_OK\r\nSpam: %*s ; %lf / %lf\r\n\r\n%n",
spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) {
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: cannot parse spamd output");
return DEFER;
};
};
-----------------------------

due to the inproper usage of sscanf() without limiting the input with %Xs, it is possible to overflow spamd_version.

---------BUFFER INDEX MESSUP----------------

because the author did not perform any sanitation checks on spamd_report_offset.
........
p = &spamd_buffer[spamd_report_offset];
.......

Its used as a buffer index, a int greater than 32600

... uschar spamd_buffer[32600];...

would cause pointer p to point jump out of the allocated buffer and into some other memory region in the stack , either segfaulting right away depending on the layout of the stack or corupting it later on.

EXPLOITATION:

Exploiting this bug would require social engineering and a fake spamd server. Obviously you will need to get an administrator to add your fake server to exim config.

Solution :

Run spamd locally or only add trusted spamd servers to your config ( have legitimate credentials).
Refferences----

http://www.exim.org/
http://spamassassin.apache.org/full/3.0.x/dist/spamd/PROTOCOL
http://spamassassin.apache.org/


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close