============================================================================= FreeBSD-SA-01:54 Security Advisory FreeBSD, Inc. トピック: telnetd がリモートバッファオーバーフローを持つ カテゴリ: ports モジュール: krb5/heimdal/SSLtelnet 告知日: 2001-08-20 クレジット: Sebastian 影響範囲: Ports collection prior to the correction date. 修正日: 2001-07-19 21:43:41 UTC (heimdal) 2001-07-24 15:29:39 UTC (krb5) SSLtelnet port は未修正 FreeBSD 固有: NO I. 背景 - Background telnetd is the server for the telnet remote virtual terminal protocol. telnetd は telnet リモート仮想ターミナルプロトコルのサーバである。 II. 問題の詳細 - Problem Description This advisory is closely related to the previously released FreeBSD-SA-01:49.telnetd.v1.1 advisory. That advisory pertains to the telnetd included in the base FreeBSD system. This advisory pertains to optional third-party telnetd implementations found in the FreeBSD ports collection. この勧告は、以前リリースされた FreeBSD-SA-01:49.telnetd.v1.1 勧告と 密接に関係している。以前の勧告は FreeBSD の基本システムに含まれる telnetd に関係している。今回の勧告は、FreeBSD ports コレクション中の、 サードバーティ製のオプショナルな telnetd の実装に関係している。 An overflowable buffer was found in the versions of telnetd included with several ports. These ports include: オーバフロー可能なバッファは、いくつかの ports に含まれる telnetd の バージョンに見つかった。これらの ports は以下を含む: MIT Kerberos V (security/krb5) prior to version 1.2.2_2 Heimdal (security/heimdal) prior to version 0.4b_1 SSLtelnet (net/SSLtelnet) - this port is not yet fixed; see below. バージョン 1.2.2_2 以前の MIT Kerberos V (security/krb5) バージョン 0.4b_1 以前の Heimdal(security/heimedal) SSLtelnet (net/SSLtelnet) - この port はまだ修正されていない。以下を参照。 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. リモートクライアントに対する出力のデータバッファの不適切な境界検査のため、 攻撃者は telnetd プロセスのバッファをオーバーフローさせる、クラッシュさせる、 (たいてい root 権限で動作している telnetd の権限で)任意のコードを実行する ことが可能である。この脆弱性を突くために有効なカウントや無効なパスワードは 不要で、telnetd サーバへ接続できさえすればよい。 These ports are not installed by default, nor are they "part of FreeBSD" as such: they are part of the FreeBSD ports collection, which contains over 5600 third-party applications in a ready-to-install format. The ports collection shipped with FreeBSD 4.3 is vulnerable to this problem since it was discovered after its release, but the problems with the krb5 and heimdal ports were corrected prior to the (forthcoming) release of FreeBSD 4.4. これらの ports はデフォルトではインストールされない。また、それ自体が "FreeBSDの一部" でもない: インストール可能な形式の 5600 個以上の サードパーティアプリケーションを含む FreeBSD ports コレクションの 一部である。FreeBSD 4.3 のリリース後にこの脆弱性が発見されたため、 同時にリリースされた ports コレクションにはこの問題に対して脆弱である。 しかし、krb5 と heimdal ports のこの問題は、(次の)FreeBSD 4.4 の リリース以前に修正された。 The SSLtelnet vulnerability has not yet been corrected: due to divergences in the code, it is more difficult to correct the vulnerability in that port. This advisory will be reissued once the vulnerability is corrected. SSLtelnet の脆弱性はまだ修正されていない: コード中の分岐のため、 port 中で脆弱性を修正するのがより難しい。この勧告はこの脆弱性が 修正されたとき再発行されるだろう。 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 lines in /etc/inetd.conf that begin with the word `telnet', if present, e.g. 1) telnet サービスを無効にする(大抵 inetd から起動される): /etc/inetd.conf 中の `telnet' という単語で始まる行をコメントアウトする。 telnet stream tcp nowait root /usr/local/libexec/telnetd telnetd telnet stream tcp6 nowait root /usr/local/libexec/telnetd telnetd and execute the following command as root: そして 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. 2) telnet サービスへのアクセスを信頼するマシンに制限するため、周囲の ファイアウォールやローカルマシン上で TCP wrapper (/etc/hosts.allow) や、 ipfw(8)・ipf(8) といったネットワークレベルのパケットフィルタを使って アクセス制限をかける。 3) Deinstall the affected ports/packages if they are installed. 3) もし影響を受ける port/package がインストールされていれば、それを 削除する。 V. 解決法 - Solution The updated ports include fixes for this vulnerability: この脆弱性の修正を含む、アップデートされた ports: krb5-1.2.2_2 and later heimdal-0.4b_1 and later 1) Upgrade your entire ports collection and rebuild the affected ports (packages are not currently available for these ports). 1) ports コレクション全体をアップグレードし、影響を受ける ports を 再構築する(これらの ports の package は現在利用できない)。 2) Download a new port skeleton for the affected ports from: 2) 以下から影響を受ける ports の新しい port スケルトンをダウンロードする: http://www.freebsd.org/ports/ and use it to rebuild the port. これを使って port を再構築する。 3) Use the portcheckout utility to automate option (2) above. The portcheckout port is available in /usr/ports/devel/portcheckout or the package can be obtained from: 3) 上の (2) を自動化するために portcheckout ユーティリティを使う。 portcheckout の port が /usr/ports/devel/portcheckout で利用できる ほか、pakage が以下で入手できる: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/devel/portcheckout-2.0.tgz ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/devel/portcheckout-2.0.tgz VI. 修正の詳細 - Correction details The following list contains the revision numbers of each file that was corrected in the FreeBSD ports collection. 以下のリストは FreeBSD ports コレクションで修正された個々のファイルの リビジョン番号を含んでいる. Affected port (module) 影響を受ける port(モジュール) Path Revision ------------------------------------------------------------------------- MIT Kerberos V (krb5) ports/security/krb5/Makefile 1.27 ports/security/krb5/files/patch-appl::telnet::telnetd::authenc.c 1.1 ports/security/krb5/files/patch-appl::telnet::telnetd::ext.h 1.2 ports/security/krb5/files/patch-appl::telnet::telnetd::slc.c 1.1 ports/security/krb5/files/patch-appl::telnet::telnetd::state.c 1.2 ports/security/krb5/files/patch-appl::telnet::telnetd::telnetd.c 1.2 ports/security/krb5/files/patch-appl::telnet::telnetd::termstat.c 1.1 ports/security/krb5/files/patch-appl::telnet::telnetd::utility.c 1.2 Heimdal (heimdal) ports/security/heimdal/Makefile 1.39 ports/security/heimdal/files/patch-ad 1.6 ------------------------------------------------------------------------- VII. 参考文献 - References