ftp.exe anf tftp.exe buffer overflows

From: Max (rusmir@tula.net)
Date: 02/28/03

  • Next message: Martin Eiszner: "axis2400 webcams"
    Date: Thu, 27 Feb 2003 16:43:21 -0800 (PST)
    From: Max <rusmir@tula.net>
    To: bugtraq@securityfocus.com
    
    

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hello there,

    ftp.exe and tftp.exe both have the same problem with unchecked hostname length.

    Description:
        ftp.exe and tftp.exe do not check the length of hostname parameter before
        passing it to gethostbyname(). This makes possible to crash them by providing
        a long enough (~550+ bytes) hostname string.

        According to Microsoft:

        (http://msdn.microsoft.com/library/en-us/winsock/winsock/gethostbyname_2.asp)

        "The gethostbyname function does not check the size of the name parameter
        before passing the buffer. In improperly sized name parameters,
        heap corruption can occur."

    Although it is sort of strange behaviour, it is documented.
    A good advice for MS developers is to read function description before using it.

    Both problems tested on up-to-date W2KPro.

    Thanks,

    Max.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD8DBQE+XrCw8mCpXsrcXpwRAvrCAKDrQ9HALqCl3w1F23xsEEgAD4is9ACg7uHC
    c5aVcrLBTzJ0/o4WJXsLVnM=
    =20xF
    -----END PGP SIGNATURE-----



    Relevant Pages

    • Re: LANs, DHCP, and local name server question
      ... each client PC is actually passing the hostname up with the DHCP request ...
      (uk.comp.os.linux)
    • Re: GSSAPI / Kerberos ticket authentication issues
      ... instead of just passing the default to ... The local hostname is determined by calling ... gethostbyname() on the result of gethostname, ... I can probably come up with a provisional patch for you in short ...
      (comp.protocols.kerberos)
    • Re: System.Net.Dns????
      ... and is listed in the dns.. ... I am just trying to pass an IP address and get the Host name... ... And getting IP address by passing hostname can be done using: ...
      (microsoft.public.dotnet.languages.vb)
    • Re: @Home network subject to DHCP hijacking
      ... @Home network subject to DHCP hijacking ... > It is also trivial to acquire this hostname parameter, ... Not being an expert in DHCP, ... > hostname for my hostname parameter would at least raise the ...
      (Bugtraq)