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:

September 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    2 Files
  • 2
    Sep 2nd
    21 Files
  • 3
    Sep 3rd
    0 Files
  • 4
    Sep 4th
    17 Files
  • 5
    Sep 5th
    34 Files
  • 6
    Sep 6th
    29 Files
  • 7
    Sep 7th
    11 Files
  • 8
    Sep 8th
    25 Files
  • 9
    Sep 9th
    0 Files
  • 10
    Sep 10th
    0 Files
  • 11
    Sep 11th
    26 Files
  • 12
    Sep 12th
    23 Files
  • 13
    Sep 13th
    17 Files
  • 14
    Sep 14th
    22 Files
  • 15
    Sep 15th
    16 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    19 Files
  • 19
    Sep 19th
    60 Files
  • 20
    Sep 20th
    23 Files
  • 21
    Sep 21st
    15 Files
  • 22
    Sep 22nd
    8 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 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