Bug 239890 (CVE-2007-2683)

Summary: CVE-2007-2683 Buffer overflow in mutt's gecos structure handling
Product: [Other] Security Response Reporter: Lubomir Kundrak <lkundrak>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: mlichvar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://dev.mutt.org/trac/ticket/2885
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-14 12:42:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 240176, 241247, 241652, 838048    
Bug Blocks:    

Description Lubomir Kundrak 2007-05-11 22:44:57 UTC
Description of problem:

An overflow can be caused when mutt tries to expand "&" in real name
gecos field to uppercase login, and real name string length plus login name
length is more than 256 characters.

This can be reached viea two vectors -- at startup, it expands the real name of
the user launching mutt. This is only under control of the user, so to exploit
it he would have to voluntarily malform his real name field, all he'll get
would be to execute code as himself. No security impact here.

Second vector is alias expansion. If mutt user has an alias for a
local user, in form 'alias aliasname username # and thus not "alias aliasname
User Name <username>"' mutt does exactly the same thing for username. It is
questionable how likely is it for a local user to exist in someone's alias file
and have a malicious realname though.

Version-Release number of selected component (if applicable):

mutt-1.4.2.2-5

Steps to Reproduce:

# USERNAME=$(perl -e 'print "a" x 31')
# useradd -c "&&&&&&&&& your-favourite-ascii-shellcode-here" $USERNAME
# echo alias billg $USERNAME >~/.muttrc
# mutt billg
Segmentation fault (core dumped)
#

Comment 1 Lubomir Kundrak 2007-05-11 22:46:40 UTC
As the problematic call is to memmove(), this should be caught by
_FORTIFY_SOURCE=2 on FC and RHEL5, and thus have no security impact
at all there.

Comment 2 Lubomir Kundrak 2007-05-15 16:34:29 UTC
        Doesn't Affect: RHEL2.1
        Affects: RHEL3
        Affects: RHEL4
        Doesn't Affect: RHEL5 (_FORTIFY_SOURCE, impact=none)
        Doesn't Affect: FC5 (_FORTIFY_SOURCE, impact=none)
        Doesn't Affect: FC6 (_FORTIFY_SOURCE, impact=none)

Comment 3 Lubomir Kundrak 2007-05-29 11:45:50 UTC
Not caught by fortify source. I had mistaken.