FreeBSD-SA-05:01.telnet "telnet client buffer overflows"

The FreeBSD Project よりセキュリティ勧告が出ました。要点を以下にまとめます。

  • Stelnet(TELNETクライアントプログラム。telnetd、つまりデーモンではない。)にバッファオーバーフローが発生する脆弱性がある。
  • この脆弱性により以下の可能性がある。
    • 悪意あるサーバにtelnetで接続すると送り込まれた悪意あるコードを実行してしまう。
    • 安全ではないネットワークでtelnetを使用した場合、なりすましにより悪意ある者の送った悪意あるコードを実行してしまう。
  • 従って安全が確認できないサーバに対して、または安全ではないネットワークでtelnetを使用してはならない。

以下は私個人の捕捉的見解です。

  • telnetはクライアントプログラムであるため、攻撃は受動的なものに限られます。しかし、URLにはtelnetプロトコルも記述可能であり、ブラウザによっては、それとはわからないようにリンクを張る事によってtelnetを起動し、悪意あるサーバに接続させるよう誘導される可能性があります。
  • telnetは他の各種プロトコルの動作検証などの目的で良く使用されるプログラムでもあります。セキュリティホールを修正し、更新が完了するまでは使用を控えるべきでしょう。
  • セキュリティ勧告ではサポート対象のブランチのみ記述されています。しかし、このセキュリティーホール過去のすべてに(-CURRENTと5.[0-2]や記述されていない4.*、さらに3.*や2.*、そしてそれ以前にも)存在します*1

セキュリティ勧告は ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:01.telnet.asc にあります。

I. 背景 - Background

The telnet(1) command is a TELNET protocol client, used primarily to establish terminal sessions across a network.

II. 問題の詳細 - Problem Description

Buffer overflows were discovered in the env_opt_add() and slc_add_reply() functions of the telnet(1) command. TELNET protocol commands, options, and data are copied from the network to a fixed-sized buffer. In the case of env_opt_add (CAN-2005-0468), the buffer is located on the heap. In the case of slc_add_reply (CAN-2005-0469), the buffer is global uninitialized data (BSS).

III. 影響範囲 - Impact

These buffer overflows may be triggered when connecting to a malicious server, or by an active attacker in the network path between the client and server. Specially crafted TELNET command sequences may cause the execution of arbitrary code with the privileges of the user invoking telnet(1).

IV. 回避方法 - Workaround

Do not use telnet(1) to connect to untrusted machines or over an untrusted network.

><

*1:src/usr.bin/telnet/telnet.cのRevision 1.1より変更されていない部分です。存在していないものは確認できませんでした。