IBM AIX 4.3.x and 5.1: Buffer overflow vulnerability in telnet daemon

IBM AIX 4.3.x and 5.1: Buffer overflow vulnerability in telnet daemon

Post by advis.. » Thu, 02 Aug 2001 09:18:07

IBM Global Services
Managed Security Services
Outside Advisory Redistribution

1 AUG 2001  0:30 GMT                              MSS-OAR-E01-2001:298.1
The MSS Outside Advisory Redistribution is designed to provide customers
IBM Managed Security Services with access to the security advisories
sent out by other computer security incident response teams, vendors, and
other groups concerned about security.

IBM makes no representations and assumes no responsibility for the
or accuracy of the advisories themselves.

IBM MSS is forwarding the following information from IBM.
Contact information for IBM is included in the forwarded text
below. Please contact them if you have any questions or need further
----------- Forwarded Information Starts Here.


Fri Jul 27 13:17:01 CDT 2001
                           VULNERABILITY SUMMARY

VULNERABILITY:    Buffer overflow vulnerability in telnet daemon

PLATFORMS:        IBM AIX 4.3.x and 5.1

SOLUTION:         Apply the emergency-fixes described below, or
                  employ the workaround, also described below.

THREAT:           Malicious user could obtain root privileges or
                  could force a system crash.

CERT Advisory:    CA-2001-21

                           DETAILED INFORMATION

I.  Description

    AIX ships with a version of the "telnet" daemon, derived from the
    original BSD version.

    This daemon is shipped SUID, or "set user ID", and is
    executable by an ordinary user.

    In the AIX version of "telnetd", as well as most other versions
    of "telnetd" derived from the BSD telnet daemon, there exists a buffer
    overflow vulnerability in telrcv(), the function that processes
    various options under telnet. There is an output buffer in the
    function that holds the information gathered during the parsing
    of the option request and the daemon's internal state. This
    buffer is not bounds checked, allowing for the possibility of
    forcing an overflow condition in the stack when the buffer
    returns its data to the telnet client.

II. Impact

   A malicious local or remote user can use a well-crafted exploit code
   to gain root privileges on the attacked system, compromising the
   integrity of the system and its attached local network.

   IBM believes this is a difficult vulnerability to exploit with the
   goal of obtaining enhanced system privileges, but it is not very
   difficult to force a core dump, and possibly a system crash.
   Exploits already exist in the wild, and are being maliciously

   An exploit obtained by the AIX Security Team has been shown to
   produce a core dump, though AIX remained stable. Other exploits,
   though, may cause more serious harm.

   Customers are urged to take measures to close this

III.  Solutions


      If you do not wish to install the efix for this vulnerability
      but instead wait for the APAR that fixes it to be made
      available, you can also negate this vulnerability by making the
      telnet daemon to be non-SUID. You must be "root" to do this.
      However, ordinary users will not be able to use the daemon if
      the SUID bit is removed.

      Customers may wish to consider replacing telnet with a version
      of Secure Shell (SSH), available from a variety of providers,
      as a security enhancement over telnet.

  B.  Official fix

      IBM is working on the following fixes which will be available

      AIX 4.3.x and 5.1: APAR assignment pending.

      NOTE: Fix will not be provided for versions prior to 4.3 as
      these are no longer supported by IBM. Affected customers are
      urged to upgrade to 4.3.3 at the latest maintenance level,
      or to 5.1.

  C.  How to minimize the vulnerability

    Temporary fixes for AIX 4.3.x and 5.1 systems are available.

    The temporary fixes can be downloaded via ftp from:

    The efix compressed tarball consists of two fixes: one for
    AIX 4.3.3 and one for AIX 5.1. It also includes this Advisory.
    The two fix files are "telnetd.433" for 4.3.3 and "telnetd.510"
    for 5.1.

    These temporary fixes have not been fully regression tested; thus,
    IBM does not warrant the fully correct functioning of the efix.
    Customers install the efix and operate the modified version of AIX
    at their own risk.

    To proceed with efix installation:

    First, verify the MD5 cryptographic hash sums of each efix file
    you obtain from unpacking the tarball with those given below. These
    should match exactly; if they do not, contact the AIX Security Team
    at and describe the discrepancy.

    Filename        sum             md5
    telnetd.433     47297   408     c7b16982f7f2011560c1b726eeae5c64
    telnetd.510     33124   383     7fa323119fa312c2c62dc7cd539d58ec

    Efix Installation Instructions:

    IMPORTANT NOTICE: If you are running AIX 4.3.3 you must install
    the version of libc (in package bos.rte.libc) that is at the level of, or higher, before proceeding with the efix installation
    for AIX 4.3.3.

    1. Become root, if not already done.

    2. Change to the /usr/sbin directory.

       Make a backup copy of the existing telnet binary, giving it
       a distinctive, meaningful name, such as "telnetd.original"
       or "telnetd.backup". This is IMPORTANT to do, so you can
       recover the orginal telnetd binary if something goes wrong during
       the installation of the efix!

       Do the above by executing "mv telnetd telnetd.original".

    3. In the tmp ("/tmp") directory, download, uncompress, and untar
       the efix.

       a. uncompress telnetd_efix.tar
       b. tar -xvf telnetd_efix.tar

    4. You will have two files: "telnetd.433" and
       "telnetd.510". Keep the tarfile appropriate for your
       version of AIX (i.e., "433" for 4.3.3; "510" for 5.1);
       You may remove the unneeded version.

    5. Now change back to the directory /usr/sbin. Doublecheck that
       you have made a backup of your original telnetd.

    6. Execute "cp /tmp/ telnetd", where "xyz" is either
       "433" or "510", as appropriate.

    7. Execute "chmod 4554 telnetd".

    8. Execute "chown root:system telnetd".

    9. Execute "sync; sync; sync;"

   10. Execute "refresh -s inetd".

IV. Obtaining Fixes

IBM AIX APARs may be ordered using Electronic Fix Distribution (via the
FixDist program), or from the IBM Support Center.  For more information
on FixDist, and to obtain fixes via the Internet, please reference

or send email to "" with the word "FixDist" in the
"Subject:" line.

To facilitate ease of ordering all security related APARs for each AIX
release, security fixes are periodically bundled into a cumulative APAR.
For more information on these cumulative APARs including last update and
list of individual fixes, send email to "" with
the word "subscribe Security_APARs" in the "Subject:" line.

V.  Acknowledgements

    Many thanks to the TESO group in Germany and to "Sebastian", a
    poster to the BUGTRAQ mailing list, for finding & bringing this
    vulnerability to our attention.

VI.  Contact Information

Comments regarding the content of this announcement can be directed to:

To request the PGP public key that can be used to encrypt new AIX
security vulnerabilities, send email to
with a subject of "get key".

If you would like to subscribe to the AIX security newsletter, send a
note to with a subject of "subscribe Security".
To cancel your subscription, use a subject of "unsubscribe Security".
To see a list of other available subscriptions, use a subject of

IBM and AIX are a registered trademark of International Business
Machines Corporation.  All other trademarks are property of their
respective holders.

Version: PGP 6.5.2


----------- Forwarded Information Ends Here.
IBM's Managed Security Services (MSS) is a subscription-based Internet
security response service that includes computer security incident
and management, regular electronic verification of your Internet
gateway(s), and security vulnerability alerts similar to this one that are
tailored to your specific computing environment.  By acting as an
of your own internal security staff, IBM MSS's team of Internet security
experts helps you quickly detect and respond to attacks and exposures
across your Internet connection(s).

As a part of IBM's Business Continuity and Recovery Service IBM's Managed
Security Services is a component of IBM Global Services Privacy and
Security Services suite of offerings.  To find out more about IBM Managed
Security Services, send an electronic mail message to, or call 1-800-426-7378.

IBM MSS maintains a site on the World Wide Web at
Visit the site for information about the service, copies of security ...

read more »


IBM AIX 4.3.x and 5.1: Buffer overflow vulnerability in telnet daemon

Post by Dale Talco » Thu, 02 Aug 2001 18:53:52


>                           VULNERABILITY SUMMARY
>VULNERABILITY:    Buffer overflow vulnerability in telnet daemon
>PLATFORMS:        IBM AIX 4.3.x and 5.1
>SOLUTION:         Apply the emergency-fixes described below, or
>                  employ the workaround, also described below.
>      If you do not wish to install the efix for this vulnerability
>      but instead wait for the APAR that fixes it to be made
>      available, you can also negate this vulnerability by making the
>      telnet daemon to be non-SUID. You must be "root" to do this.
>      However, ordinary users will not be able to use the daemon if
>      the SUID bit is removed.

This does not match my understanding of the description of the problem.
The exploit happens during option negotiation, which can occur while the
daemon, started from inetd, is running as root.  Thus, removing
setuid from the daemon would not prevent an exploit.

Next, the advisory says removing setuid will somehow affect whether
it can be used.  Because telnetd is not started directly by users
under normal circumstances, but only from inetd, which already starts
it as root, I cannot see how users would be affected.  In my limited
testing, removing setuid had no effect on whether I could telnet to
the system.

Why is IBM's telnetd setuid in the first place?  Solaris and OpenBSD,
for example, do not use setuid telnetd's.

Dale Talcott, Purdue University Computing Center