Bug 469415

Summary: Security bug in tmail and dmail
Product: [Fedora] Fedora EPEL Reporter: Pawel Salek <pawsa>
Component: uw-imapAssignee: Rex Dieter <rdieter>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: medium    
Version: el5CC: rdieter, security-response-team
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-31 19:02:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 469667    

Description Pawel Salek 2008-10-31 18:30:34 UTC
Description of problem:
Copied from a post to imap-uw@u.washington.edu:

There is a security bug in versions of the programs tmail and dmail distributed with the IMAP Toolkit versions 2007c or earlier (all versions prior to 2008-10-29). This includes the version distributed with Alpine 2.00. A fixed version of the programs is included in the IMAP Toolkit version 2007d.[cut]

If you are using tmail or dmail you should replace them with the fixed versions immediately. The bug is exploitable by local users with shell access and may be remotely exploitable on some systems. A default sendmail installation with tmail as a delivery agent is not remotely exploitable because of length limits imposed by sendmail.[cut]

http://mailman2.u.washington.edu/pipermail/imap-uw/2008-October/002267.html

Comment 1 Rex Dieter 2008-10-31 18:35:51 UTC
Pkgs built, update pending.

Comment 2 Rex Dieter 2008-10-31 19:02:40 UTC
updates push underway, expect to see uw-imap-2007d-1.el5 landing soon in an epel repo near you.

Comment 3 Tomas Hoger 2008-11-03 11:08:25 UTC
Rex, Pawel, do you have any further details about these issues?  Upstream announcement is fairly vague.  Additionally, description suggests that tmail issue can be used by local shell users to get root, but can not be exploited remotely over MTA.  On the first read, it sounds like this would expect tmail to be setuid root, which does not seem to be the case with Fedora packages by default, but seems to be suggested as required in some setups.

Sorry, I'm not very familiar with uw-imap, so suggestions are welcome.

Comment 4 Pawel Salek 2008-11-03 12:16:31 UTC
It's a classical stack overflow that can be triggered by passing
+VERYLONGSTRING as the argument to [dt]mail. The program attempts to copy the
string to a temporary buffer without checking its length. This is only root
exploit if the program is suid root. It is a remote exploit if the smtp
delivery program passes the argument to tmail longer than 1024 characters (eg
via $u variable in 
define(`LOCAL_MAILER_ARGS', `tmail $u')dnl

Comment 5 Tomas Hoger 2008-11-03 13:55:03 UTC
Pawel, thanks for the hint.  It seem to be consistent with what I managed to find out so far.  Further comments will be added to bug #469667, that will be used to track the issue across all affected products.