============================================================================= FreeBSD-SA-01:49 Security Advisory FreeBSD, Inc. トピック: telnetd がリモートバッファオーバーフローを含む カテゴリ: core モジュール: telnetd 告知日: 2001-07-23 改訂日: 2001-07-27 クレジット: Sebastian 影響範囲: 全ての FreeBSD 3.x、4.4 以前の 4.x 修正日以前の FreeBSD 4.3-STABLE 修正日: 2001-07-23 FreeBSD 固有: NO 0. 改訂履歴 - Revision History 2001-07-23 v1.0 初版 2001-07-27 v1.1 patch の命令のアップデート、kerberosIV パッケージが 利用可能、回避方法で SSH へのリファレンスを追加 I. 背景 - Background telnetd is the server for the telnet remote virtual terminal protocol. telnetd は telnet リモート仮想ターミナルプロトコルのサーバである。 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. FreeBSD に含まれている telnetd のバージョンに、オーバーフロー可能なバッファが 発見された。リモートクライアントへの出力用にバッファされるデータの境界検査 が不適切なため、攻撃者は telnetd のプロセスのバッファをオーバーフローさせ 、プロセスをクラッシュさせたり、telnetd を実行しているユーザ(たいてい root) の権限で任意のコードを実行したりできる。この脆弱性を利用するためには、有効な ユーザアカウントとパスワードは必要なく、telnetd サーバに接続する能力さえ あれば良い。 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. telnetd サービスは、インストール時に 'high' セキュリティ設定が選択されて いなければ、全ての FreeBSD のインストレーションにおいて、デフォルトで有効に されている。この脆弱性は、利用可能であることが知られているため、野蛮な世界 (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. 3.5.1-RELEASE と 4.3-RLEASE を含む、修正日以前にリリースされている全ての バージョンの FreeBSD はこの問題に対して脆弱である。次の 4.4-RELEASE の リリース前には、この問題は修正された。 III. 影響範囲 - Impact Remote users can cause arbitrary code to be executed as the user running telnetd, usually root. リモートユーザは、telnetd を作動させているユーザ(たいてい 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. 1) telnet サービスを無効にする。これはたいてい inetd から起動される: 現在であれば、/etc/inetd.conf 以下の行をコメントアウトする。 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: そして root で以下のコマンドを実行する: # kill -HUP `cat /var/run/inetd.pid` An alternative remote login protocol such as the SSH secure shell protocol (which is installed by default in FreeBSD), can be used instead. The SSH protocol is the recommended protocol for remote logins to FreeBSD systems because of the superior authentication, confidentiality and integrity protection it supplies relative to other protocols such as telnet. 代わりに、SSH secure shell protocol(FreeBSD ではデフォルトでインストール されている)のような代用のリモートログインプロトコルを使うこともできる。 SSH プロトコルは、telnet のような他のプロトコルと比較して、優れた認証、 機密性、完全性の保護を提供するため、FreeBSD システムへのリモートログインの ために薦められているプロトコルである。 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. 2) telnet サービスへのアクセスを信頼されたマシンに制限するため、ファイア ウォールの周辺やローカルマシンで、TCP wrappers (/etc/hosts.allow) や ipfw(8) や ipf(8) のようなネットワークレベルのパケットフィルタを使って アクセス制限を課す。 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. 1) 脆弱性のある FreeBSD システムを、それぞれの更新日以降の 4.3-STABLE や RELENG_4_3 セキュリティブランチへアップグレードする。 2) FreeBSD 3.5.1, 4.x systems prior to the correction date: 2) 修正日以前の FreeBSD 3.5.1、4.x システム: 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: /usr/src/crypto/telnet ソースが存在する場合としない場合の、2つのバージョンの パッチが利用可能である。システムに crypto-telnet ソースがインストールされて いるか確認するためには、以下のコマンドを実行する: # 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 crypto sources present and should download the non-crypto-telnet patch: see section 2b) below. 現在 crypto ソースが存在せず、non-crypto-telnet パッチをダウンロード すべきであることを示す: 以下のセクション 2b) を見よ。 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. これらのパッチは FreeBSD 4.2-RELEASE、4.3-RELEASE および 2001-07-20 以前の日付の 3.5.1-STABLE について適用を確認した(3.5.1-RELEASE の ユーザは、このパッチを適用する前に、FreeBSD セキュリティ勧告 00:69 の パッチを適用していなければならない)。これらのパッチの、より古い サポートされていない FreeBSD のリリースへの適用は不明である。 2a) For systems with the crypto-telnet sources installed 2a) crypto-telnet ソースがインストールされたシステム Under FreeBSD 4.x, the crypto-telnet client can be built in two versions: with or without support for the KerberosIV authentication system. Under FreeBSD 3.x there is only one way to build the crypto-telnet client: with KerberosIV support. FreeBSD 4.x では、crypto-telnet クライアントは2つのバージョンが作成 できる: KerberosIV 認証システムをサポートする、しない。 FreeBSD 3.x では、crypto-telnet クライアントを作成するために一つの 方法しかない: KerberosIV をサポートする。 To determine whether your system has the kerberosIV distribution installed, perform the following command: システムが kererosIV のディストリビューションをインストールしているか 確認するには、以下のコマンドを実行する: # ls /usr/lib/libkrb.a Possible responses: 起こりうる応答: /usr/lib/libkrb.a # This response indicates you have kerberosIV present # この応答は、現在 kerberosIV がある事を示す ls: /usr/lib/libkrb.a: No such file or directory # This reponse indicates you do not have # kerberosIV present # この応答は、現在 kerberosIV がない事を示す。 Download the patch and the detached PGP signature from the following locations, and verify the signature using your PGP utility. 以下の場所からパッチと PGP シグネチャをダウンロードする。そして PGP ユーティリティを使ってシグネチャを確認する。 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 2aa) For systems with the crypto-telnet sources installed but without KerberosIV installed 2aa) crypto-telnet ソースはインストールされているが、KerberosIV はインストール されていないシステム [FreeBSD 4.x systems] # cd /usr/src/ # patch -p < /path/to/patch # cd /usr/src/secure/lib/libtelnet # make depend && make all # cd /usr/src/secure/libexec/telnetd # make depend && make all install [FreeBSD 3.x systems] # cd /usr/src/ # patch -p < /path/to/patch # cd /usr/src/lib/libtelnet # make depend && make all # cd /usr/src/libexec/telnetd # make depend && make all install 2ab) For systems with the crypto-telnet sources installed and with KerberosIV installed 2ab) crypto-telnet ソースがインストールされており、かつ KerberosIV もインストール されているシステム # cd /usr/src/ # patch -p < /path/to/patch # cd /usr/src/kerberosIV/lib/libtelnet # make depend && make all # cd /usr/src/kerberosIV/libexec/telnetd # make depend && make all install 2b) For systems without the crypto-telnet sources installed 2b) crypto-telnet ソースがインストールされていないシステム Download the patch and the detached PGP signature from the following locations, and verify the signature using your PGP utility. 以下の場所からパッチと PGP シグネチャをダウンロードし、PGP ユーティリティ を使ってシグネチャを確認する。 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/lib/libtelnet # make depend && make all # cd /usr/src/libexec/telnetd # make depend && make all install 3) FreeBSD 4.3-RELEASE systems: 3) FreeBSD 4.3-RELEASE システム: 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. バイナリアップグレード処理のテストとフィードバックの提供を希望するユーザの ため、実験的なアップグレードパッケージが利用可能である。このパッケージは FreeBSD 4.3-RELEASE システムのみにインストール可能で、ソースへのパッチ当て が現実的でなかったり、都合が悪かったりするシステムでの利用を意図している。 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. もしアップグレードパッケージを利用するなら、将来の勧告のためにアップ グレード処理を改良できるよう、security-officer@FreeBSD.org 宛てに フィードバック(肯定・否定を問わない)をお願いする。 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. インストール処理中に、パッケージによって上書きされるファイルのバック アップコピーが作成される。インストールしたパッケージが削除されると、 バックアップコピーが再インストールされ、システムがパッチを当てる前の 状態に戻る。 Three versions of the upgrade package are available, depending on whether or not the system has the crypto or kerberosIV distributions installed. システムに crypto や kerberosIV のディストリビューションがインストール されているかによって、3つのバージョンノアップグレードパッケージが利用可能 である。 To determine whether your system has the crypto distribution installed, perform the following command: システムに crypto ディストリビューションがインストールされているか確認する には、以下のコマンドを実行する: # ls /usr/bin/openssl Possible responses: 起こりうる応答: /usr/bin/openssl # This response indicates you have crypto present # この応答は、現在 crypto が あることを示す。 ls: /usr/bin/openssl: No such file or directory # This reponse indicates you do not have # crypto present # この応答は、現在 crypto がないことを示す。 To determine whether your system has the kerberosIV distribution installed, perform the following command: システムに kerberosIV のディストリビューションがインストールされているか 確認するには、以下のコマンドを実行する: # ls /usr/lib/libkrb.a Possible responses: 起こりうる応答: /usr/lib/libkrb.a # This response indicates you have kerberosIV present # この応答は、現在 kerberosIV があることを示す。 ls: /usr/lib/libkrb.a: No such file or directory # This reponse indicates you do not have # kerberosIV present # この応答は、現在 kerberosIV がないことを示す。 3a) If crypto is present 3a) crypto が存在する # 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. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-telnetd-crypto-01.49.tgz 3b) If kerberosIV is present 3b) kerberosIV が存在する # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:49/security-patch-telnetd-kerberosIV-01.49.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:49/security-patch-telnetd-kerberosIV-01.49.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-telnetd-kerberosIV-01.49.tgz 3c) If neither crypto nor kerberosIV are present 3c) crypto も kerberosIV も存在しない # 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. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-telnetd-01.49.tgz