SecurityReason.com - Our Reason is

Security

Register | Forget Password | Login
SecurityReason
WLB
Services
RSS
Corporate
Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Home arrow SecurityAlert Database

Arrow  Topic :

UW/Panda IMAP [dt]mail buffer overflow


Arrow  SecurityAlert : 4570
Arrow  CVE : CVE-2008-5005
Arrow  CWE : CWE-119
Arrow  SecurityRisk : High  Security Risk High  (About)
Arrow  Remote Exploit : Yes
Arrow  Local Exploit : No
Arrow  Victim interaction required : No
Arrow  Exploit Available : No
Arrow  Credit : Bitsec Labs
Arrow  Published : 11.11.2008

Arrow  Affected Software : university_of_washington:imap_toolkit:2002
university_of_washington:imap_toolkit:2003
university_of_washington:imap_toolkit:2004
university_of_washington:imap_toolkit:2005
university_of_washington:imap_toolkit:2006
university_of_washington:imap_toolkit:2007
university_of_washington:imap_toolkit:2007c
university_of_washington:alpine:2.00
university_of_washington:alpine:1.10
university_of_washington:alpine:1.00
university_of_washington:alpine:0.999999
university_of_washington:alpine:0.99999
university_of_washington:alpine:0.9999
university_of_washington:alpine:0.999
university_of_washington:alpine:0.99
university_of_washington:alpine:0.98
university_of_washington:alpine:0.83
university_of_washington:alpine:0.82
university_of_washington:alpine:0.81
university_of_washington:alpine:0.80



Arrow  Advisory Content :  

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

========================================================================
=======
Bitsec Security Advisory: UW/Panda IMAP [dt]mail buffer overflow
2008-11-03
========================================================================
=======

Applications tmail/dmail in UW IMAP [2002-2007c], Panda IMAP, Alpine <=
2.00

Discovered by Aron Andersson <aron.andersson (at) bitsec (dot) com [email
concealed]>,
Jan Sahlin <jan.sahlin (at) bitsec (dot) com [email
concealed]>
Researched by Aron Andersson <aron.andersson (at) bitsec (dot) com [email
concealed]>

Reference http://www.bitsec.com/en/rad/bsa-081103.txt
GPG Key http://www.bitsec.com/labs.asc

Overview

tmail and dmail are mail delivery agents that deliver mail to a user's
INBOX
or a designated folder, specified by the folder extension in the
user+folder
argument on the command line. If tmail is used for mail delivery from a
process whose UID is not the destination user, it must be installed
setuid
root; dmail can be used when the process is run as the destination user.

Problem

A vulnerability exists in both applications due to missing boundary checks
on
the folder extension argument from the command line. The bug can be
exploited
by overflowing a stack buffer via an overly long folder name.

For tmail, this could allow for arbitrary code execution as the root user.
As
mentioned the vulnerability also exists for dmail, but the impact is a
bit
less critical since it usually runs as the recipient user and not root.

Depending on the mailer daemon and configuration in use, this bug may also
be remotely exploitable.

The bug is caused by the following pieces of code:
[tmail.c]
char *getusername (char *s,char **t)
{
char tmp[MAILTMPLEN];
if (*t = strchr (s,'+')) { /* have a mailbox specifier? */
*(*t)++ = '\0'; /* yes, tie off user name */
/* user+ and user+INBOX same as user
*/
if (!**t || !strcmp ("INBOX",ucase (strcpy (tmp,*t)))) *t = NIL;
}
return s; /* return user name */
}

[dmail.c]
int deliver (FILE *f,unsigned long msglen,char *user)
{
MAILSTREAM *ds = NIL;
char *s,*mailbox,tmp[MAILTMPLEN],path[MAILTMPLEN];
STRING st;
struct stat sbuf;
/* have a mailbox specifier? */
if (mailbox = strchr (user,'+')) {
*mailbox++ = '\0'; /* yes, tie off user name */
if (!*mailbox || !strcmp ("INBOX",ucase (strcpy (tmp,mailbox))))
mailbox = NIL; /* user+ and user+INBOX same as user
*/
}
(..)

The user+folder command line argument reaches deliver() and getusername()
through the char pointers 's' and 'user', respectively. The folder part
is
separated from the user and copied to the buffer 'tmp'. Since 'tmp' is
placed
on the stack, an overly long folder name can be used to overwrite stack
data,
including but not limited to the saved EIP.

Exploit

A proof-of-concept exploit for this vulnerability has been developed but
will
not be publicly released until 2008-11-10, by which time it can be found
at

http://www.bitsec.com/en/rad/bsa-081103.c

Fix

Upgrade to the latest version from your IMAP vendor:

- UW IMAP: 2007d
http://www.washington.edu/imap/

- Panda IMAP: tmail ver 2008.24, dmail ver 2008.19
http://www.panda.com/imap/

- Alpine: No fix, tmail/dmail users should get UW IMAP 2007d
http://www.washington.edu/alpine/

Disclosure Timeline

2008-10-24 Notified developers (Mark Crispin, Steve Hubert)
2008-10-27 Received response from developers
2008-10-27 Panda IMAP patched
2008-10-30 UW IMAP patched
2008-11-03 Public release

========================================================================
=======
Bitsec Security Advisory: UW/Panda IMAP [dt]mail buffer overflow
2008-11-03
========================================================================
=======
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJDuPnzx20c5GX95oRApDFAKCLzTOOPmHsoGCcgxkbZvtCSFQujgCgugO/
yjilZ4XHBYXTPEXbVVnS7Rk=
=OsgS
-----END PGP SIGNATURE-----



Arrow  References :

https://bugzilla.redhat.com/show_bug.cgi?id=469667
http://mailman2.u.washington.edu/pipermail/imap-uw/2008-October/002267.html
http://www.securityfocus.com/archive/1/archive/1/498002/100/0/threaded
http://www.openwall.com/lists/oss-security/2008/11/03/5
http://www.openwall.com/lists/oss-security/2008/11/03/4
http://www.openwall.com/lists/oss-security/2008/11/03/3
http://www.bitsec.com/en/rad/bsa-081103.txt
http://securitytracker.com/id?1021131
http://secunia.com/advisories/32483
http://panda.com/imap/
http://marc.info/?l=full-disclosure&amp;m=122572590212610&amp;w=4
http://mailman2.u.washington.edu/pipermail/imap-uw/2008-October/002268.html




Arrow  Feedback :

If you have additional information or notice any errors regarding this security advisory, please use contact form or email us at info()securityreason()com.
Alert

libc:fts_*() Multiple Denial of Service

Security Risk Medium- 2009-10-02

The fts functions are provided for traversing UNIX file hierarchies...

Apache RSS Apache Alert

» Apache 1.3.41 mod_proxy
   Integer overflow (code
   execution)

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion in work
   directory

» Apache Tomcat 6.0.20 and
   5.5.28 insecure partial
   deploy after failed
   undeploy

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion and/or
   alteration

PHP RSS PHP Alert

» PHP 5.2.12/5.3.1
   session.save_path
   safe_mode and
   open_basedir bypass

» PHP 5.2.12/5.3.1 Multiple
   Vulnerabilities

» PHP 5.2.11 libgd multiple
   vulnerabilities

» PHP 5.2.11 tempnam()
   safe_mode bypass

Copyright © SecurityReason.com. All Rights Reserved.