Home / vulnerabilities bsa-081103.txt
Posted on 04 November 2008
Source : packetstormsecurity.org Link
-----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@bitsec.com>,
Jan Sahlin <jan.sahlin@bitsec.com>
Researched by Aron Andersson <aron.andersson@bitsec.com>
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)++ = '