[UNIX] Wu-FTPd SKEY Stack Overflow Vulnerability

From: SecuriTeam (support_at_securiteam.com)
Date: 10/26/03

  • Next message: SecuriTeam: "[NT] mIRC DCC Vulnerability (Long Filename)"
    To: list@securiteam.com
    Date: 26 Oct 2003 16:18:33 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      Wu-FTPd SKEY Stack Overflow Vulnerability
    ------------------------------------------------------------------------

    SUMMARY

    The Washington University FTP daemon (hereafter referred to as "wuftpd")
    is a replacement FTP server for POSIX systems. Wu-FTPd supports SKEY
    authentication to provide secure logins. However, the code that 'handles'
    this has an exploitable stack based buffer overflow. By providing
    specially crafted authentication credentials, it is possible to crash the
    daemon or execute user-supplied code, running with root privileges.

    DETAILS

    Vulnerable systems:
     * Wu-FTPd version 2.6.2 (with SKEY support enabled)

    A statically allocated buffer is filled using the sprintf() function in
    the skey_challenge() function (src/ftpd.c).

     char *skey_challenge(char *name, struct passwd *pwd, int pwok)
         $
     {
         $
         static char buf[128];
         ...
         if (pwd == NULL || skeychallenge(&skey, pwd->pw_name, sbuf))
         $
             sprintf(buf, "Password required for %s.", name);
         else
       sprintf(buf, "%s %s for %s.", sbuf,
         pwok ? "allowed" : "required", name);
         return (buf);
     }

    The variable *name is never subject to any boundaries checking. It is
    possible to write beyond the buf[] array, overwriting the return address
    of the function, modifying the path of execution flow.

    Fix/Workaround:
    To protect you from this vulnerability, disable SKEY support, or apply the
    following patch:
     % diff -u ftpd.c fixed-ftpd.c
     --- ftpd.c 2001-11-29 17:56:11.000000000 +0100
     +++ fixed-ftpd.c 2003-10-20 20:43:58.000000000 +0200
     @@ -1662,9 +1662,9 @@
          /* Display s/key challenge where appropriate. */
      
          if (pwd == NULL || skeychallenge(&skey, pwd->pw_name, sbuf))
     - sprintf(buf, "Password required for %s.", name);
     + snprintf(buf, 128-1, "Password required for %s.", name);
          else
     - sprintf(buf, "%s %s for %s.", sbuf,
     + snprintf(buf, 128-1, "%s %s for %s.", sbuf,
                     pwok ? "allowed" : "required", name);
          return (buf);
      }
     %

    Vendor status:
    Michael Hendrickx found this vulnerability in Wu-FTPd two weeks ago, and
    has been waiting for a response from the Wu-FTPd development team without
    any luck.

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:michael@scanit.be> Michael
    Hendrickx.

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[NT] mIRC DCC Vulnerability (Long Filename)"

    Relevant Pages

    • [EXPL] Wu-FTPd Remote DoS (/bin/ls)
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... A vulnerability in Wu-FTPd allows remote attackers to call the /bin/ls ... The information in this bulletin is provided "AS IS" without warranty of any kind. ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
      (Securiteam)
    • [UNIX] Trend Micro VirusWall Buffer Overflow in VSAPI Library
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... buffer overflow vulnerability in VSAPI library allows arbitrary code ... is called "vscan" which is set suid root by default. ... permissions and thus granted all local users the privilege to execute the ...
      (Securiteam)
    • [UNIX] SCO Multiple Local Buffer Overflow
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Local exploitation of a buffer overflow vulnerability in the ppp binary, ... allows attackers to gain root privileges. ...
      (Securiteam)
    • [NT] Microsoft Word 6.0/95 Document Converter Buffer Overflow (MS04-041)
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... WordPad is "a word processing application that uses the MFC rich edit ... Remote exploitation of a buffer overflow vulnerability in Microsoft ... Microsoft Word format files into the Rich Text Format natively handled by ...
      (Securiteam)
    • [UNIX] Tikiwiki Command Injection and Arbitrary File Exposure Vulnerabilities
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Two security vulnerabilities have been recently discovered in Tikiwiki, ... Remote exploitation of an input validation vulnerability in Tikiwiki ... allows attackers to gain access to arbitrary files on the vulnerable ...
      (Securiteam)