IMAP: Buffer Overflow - /bin/sh

This signature detects attempts to exploit a known vulnerability against IMAPd. Netscape Messaging Server 3.55 and University of Washington IMAPd 10.234 are susceptible. Attackers can remotely specify large values to overflow the buffer, cause the memory address for the instruction pointer to point to /bin/sh, and execute arbitrary code (in some cases as root).

Extended Description

A vulnerability exists in certain imapd implementations that allow an attacker to execute arbitrary code remotely. In certain instances, the code to be executed will be run with root privilege. Imap supports a command 'AUTHENTICATE' which specifies the type of authentication mechanism to be used to open a mailbox. The value passed to the authenticate command is copied into a buffer of size 1024. The maximum size of this value, however, it 8192 characters. A failure to bound the read value to 1024 results in a buffer overflow. The code which creates this problem is as follows: char *mail_auth (char *mechanism,authresponse_t resp,int argc,char *argv[]) { char tmp[MAILTMPLEN]; AUTHENTICATOR *auth; /* make upper case copy of mechanism name */ ucase (strcpy (tmp,mechanism)); for (auth = mailauthenticators; auth; auth = auth->next) if (auth->server && !strcmp (auth->name,tmp)) return (*auth->server) (resp,argc,argv); return NIL; /* no authenticator found */ } The 'strcpy' command on the sixth line of code will copy the value of 'mechanism', which is up to 8192 characters in to the 'tmp' buffer, which is only 1024 characters. All versions of UW imapd up to, and including 10.234 should be considered vulnerable.

Affected Products

Netscape messaging_server

Short Name
IMAP:OVERFLOW:BIN-SH
Severity
Major
Recommended
False
Recommended Action
Drop
Category
IMAP
Keywords
- /bin/sh Buffer CVE-1999-0005 Overflow bid:130
Release Date
04/22/2003
Supported Platforms

srx-branch-12.3

srx-19.3

srx-branch-19.3

vsrx3bsd-19.2

srx-branch-19.4

vsrx-19.4

mx-12.3

mx-19.4

vmx-19.4

mx-19.3

vsrx3bsd-19.4

srx-19.4

vsrx-12.3

vmx-19.3

vsrx-19.2

srx-12.3

Sigpack Version
3336
False Positive
Unknown
Vendors

University_of_washington

Netscape

CVSS Score

10.0

Found a potential security threat?