summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Holmgren <holmgren@lysator.liu.se>2007-05-14 18:56:25 +0000
committerMagnus Holmgren <holmgren@lysator.liu.se>2007-05-14 18:56:25 +0000
commit0806a9c5bfe809d616ae63fa68e959a2fac2a864 (patch)
treeccf3ad57110bf850a58633f06e5e136565943962 /src
parent2e30fa9d9b2353551db96aef5c770460f92e1515 (diff)
The "spam" ACL condition code contained a sscanf() call with a %s
conversion specification without a maximum field width, thereby enabling a rogue spamd server to cause a buffer overflow. While nobody in their right mind would setup Exim to query an untrusted spamd server, an attacker that gains access to a server running spamd could potentially exploit this vulnerability to run arbitrary code as the Exim user.
Diffstat (limited to 'src')
-rw-r--r--src/src/spam.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/src/spam.c b/src/src/spam.c
index 700200605..99c6d0c5a 100644
--- a/src/src/spam.c
+++ b/src/src/spam.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/spam.c,v 1.13 2006/09/05 14:05:43 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spam.c,v 1.14 2007/05/14 18:56:25 magnus Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -316,11 +316,11 @@ again:
(void)close(spamd_sock);
/* dig in the spamd output and put the report in a multiline header, if requested */
- if( sscanf(CS spamd_buffer,"SPAMD/%s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n",
+ if( sscanf(CS spamd_buffer,"SPAMD/%7s 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",
+ if( sscanf(CS spamd_buffer,"SPAMD/%7s 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");