FreeBSD Security Advisory FreeBSD-SA-01:49.telnetd

From: FreeBSD Security Advisories (security-advisories@FreeBSD.org)
Date: 07/24/01


Date: Mon, 23 Jul 2001 17:16:01 -0700 (PDT)
From: FreeBSD Security Advisories <security-advisories@FreeBSD.org>
To: FreeBSD Security Advisories <security-advisories@FreeBSD.org>


-----BEGIN PGP SIGNED MESSAGE-----

=============================================================================
FreeBSD-SA-01:49 Security Advisory
                                                                FreeBSD, Inc.

Topic: telnetd contains remote buffer overflow

Category: core
Module: telnetd
Announced: 2001-07-23
Credits: Sebastian <scut@nb.in-berlin.de>
Affects: All releases of FreeBSD 3.x, 4.x prior to 4.4,
                FreeBSD 4.3-STABLE prior to the correction date
Corrected: 2001-07-23
FreeBSD only: NO

I. Background

telnetd is the server for the telnet remote virtual terminal protocol.

II. Problem Description

An overflowable buffer was found in the version of telnetd included
with FreeBSD. Due to incorrect bounds checking of data buffered for
output to the remote client, an attacker can cause the telnetd process
to overflow the buffer and crash, or execute arbitrary code as the
user running telnetd, usually root. A valid user account and password
is not required to exploit this vulnerability, only the ability to
connect to a telnetd server.

The telnetd service is enabled by default on all FreeBSD installations
if the 'high' security setting is not selected at install-time. This
vulnerability is known to be exploitable, and is being actively
exploited in the wild.

All released versions of FreeBSD prior to the correction date
including 3.5.1-RELEASE and 4.3-RELEASE are vulnerable to this
problem. It was corrected prior to the forthcoming release of
4.4-RELEASE.

III. Impact

Remote users can cause arbitrary code to be executed as the user
running telnetd, usually root.

IV. Workaround

1) Disable the telnet service, which is usually run out of inetd:
comment out the following lines in /etc/inetd.conf, if present.

telnet stream tcp nowait root /usr/libexec/telnetd telnetd

telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd

and execute the following command as root:

# kill -HUP `cat /var/run/inetd.pid`

2) Impose access restrictions using TCP wrappers (/etc/hosts.allow),
or a network-level packet filter such as ipfw(8) or ipf(8) on the
perimeter firewall or the local machine, to limit access to the telnet
service to trusted machines.

V. Solution

One of the following:

1) Upgrade your vulnerable FreeBSD system to 4.3-STABLE or the
RELENG_4_3 security branch after the respective correction dates.

2) FreeBSD 3.5.1, 4.x systems prior to the correction date:

There are two versions of the patch available, for systems with and
without the /usr/src/crypto/telnet sources. To determine whether your
system has the crypto-telnet sources installed, perform the following
command:

# ls /usr/src/crypto/telnet/telnetd

A response of

ls: /usr/src/crypto/telnet/telnetd: No such file or directory

indicates you do not have the sources present and should download the
non-crypto-telnet patch.

These patches have been verified to apply to FreeBSD 4.2-RELEASE,
4.3-RELEASE and 3.5.1-STABLE dated prior to 2001-07-20 (users of
3.5.1-RELEASE must have applied the patches from FreeBSD Security
Advisory 00:69 prior to applying this patch). These patches may or
may not apply to older, unsupported releases of FreeBSD.

2a) For systems with the crypto-telnet sources installed

Download the patch and the detached PGP signature from the following
locations, and verify the signature using your PGP utility.

ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:49/telnetd-crypto.patch
ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:49/telnetd-crypto.patch.asc

# cd /usr/src/
# patch -p < /path/to/patch
# cd /usr/src/secure/libexec/telnetd
# make depend && make all install

2b) For systems without the crypto-telnet sources installed

Download the patch and the detached PGP signature from the following
locations, and verify the signature using your PGP utility.

ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:49/telnetd.patch
ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:49/telnetd.patch.asc

# cd /usr/src/
# patch -p < /path/to/patch
# cd /usr/src/libexec/telnetd
# make depend && make all install

3) FreeBSD 4.3-RELEASE systems:

An experimental upgrade package is available for users who wish to
provide testing and feedback on the binary upgrade process. This
package may be installed on FreeBSD 4.3-RELEASE systems only, and is
intended for use on systems for which source patching is not practical
or convenient.

If you use the upgrade package, feedback (positive or negative) to
security-officer@FreeBSD.org is requested so we can improve the
process for future advisories.

During the installation procedure, backup copies are made of the files
which are replaced by the package. These backup copies will be
reinstalled if the package is removed, reverting the system to a
pre-patched state.

Two versions of the upgrade package are available, depending on
whether or not the system has the crypto distribution installed. To
verify whether your system has the crypto distribution installed,
perform the following command:

# ls /usr/bin/openssl

Possible responses:

/usr/bin/openssl # This response indicates you have crypto present

ls: /usr/bin/openssl: No such file or directory
                       # This reponse indicates you do not have
                       # crypto present

3a) If crypto is not present

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:49/security-patch-telnetd-01.49.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:49/security-patch-telnetd-01.49.tgz.asc

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-telnetd-01.49.tgz

3b) If crypto is present

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:49/security-patch-telnetd-crypto-01.49.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:49/security-patch-telnetd-crypto-01.49.tgz.asc

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-telnetd-crypto-01.49.tgz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iQCVAwUBO1ywjFUuHi5z0oilAQFYSgP/Q/wEIdR8gcBveH6oDMpXJXZ72zqnEnSo
0w7jyX9D+Mi0wwvRtsZlZXDvw1R4H6ljoGIKhzlRk/ZMJej2sxTQSqew6M2dD+f6
z6wJNMY05g4RJg/KqkYozucijl0N38/pRJs1tlz2QPDxJfPGXjzrew4lrBs/QyNv
elrJ01VLliA=
=ZMBy
-----END PGP SIGNATURE-----

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message



Relevant Pages

  • FreeBSD Security Advisory FreeBSD-SA-01:49.telnetd [REVISED]
    ... FreeBSD only: NO ... telnetd is the server for the telnet remote virtual terminal protocol. ... with or without support for the KerberosIV authentication ... # make depend && make all install ...
    (FreeBSD-Security)
  • Re: Telnet exploit & 3.4-RELEASE
    ... > The exploit posted to Bugtraq DOES work on FreeBSD 3.4-RELEASE but only if ... > you selected to install an encrypting telnetd when you set the machine up. ...
    (FreeBSD-Security)
  • RE: FreeBSD Security Advisory FreeBSD-SA-02:13.openssh
    ... > The following patch has been verified to apply to FreeBSD 4.4-RELEASE, ... > may or may not apply to older, unsupported versions of FreeBSD. ... > Download the patch and the detached PGP signature from the following ... ># make depend && make all install ...
    (FreeBSD-Security)
  • Re: Configuring services for unusual ports
    ... (because I was using kr5-telnet rather than telnetd, ... > standard ports, but all servers respond on ssh externally from the same IP ... RH9 from linuxiso.org and posted a question on how best to install from ... which seems inconceivable since these are ISOs of the install CDs ...
    (comp.os.linux.networking)
  • Re: RedHat 7.2
    ... > stupid services, including ftpd, rshd, and telnetd instead of leaving them ... > people who really need it install the others. ... It's been a while since ftpd, telnet, and r-cmds ... But needing sgi-fam which needs rpc annoys me, ...
    (comp.os.linux.security)