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...
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.