============================================================================= FreeBSD-SA-01:67 Security Advisory FreeBSD, Inc. トピック: htdig の設定ファイルに関する脆弱性 (htdig configuration file vulnerability) カテゴリ: ports モジュール: htdig 告知日: 2001-12-17 クレジット: Rafal Wojtczuk 影響範囲: 修正日以前の Ports コレクション 修正日: 2001-09-25 07:08:47 2001 UTC FreeBSD 固有: NO I. 背景 - Background htsearch is a part of htdig. The htdig system is a complete World Wide Web indexing and searching system. htsearch は htdig システムの一部です。htdig システムは、インデクシングと 検索をサポートした、完全な WWW 検索システムです。 II. 問題の詳細 - Problem Description htsearch can be run either remotely as a CGI or from the command line. htsearch supports several options for use from the command line, such as an option specifying a configuration file that it should use. However, these options are not limited to use via the command line. When run as a CGI script, htsearch still honors these options, which may be passed as part of the URL. As a result, a remote attacker can request that htsearch use any file that the webserver has sufficient privilege to read as a configuration file. htsearch は、CGI 経由でリモートから実行したり、コマンドラインから 操作したりすることができます。htsearch は、使用する設定ファイルを指定する オプションなど、コマンドラインから指定できるオプションをいくつかサポート しています。ところが、これらのオプションはコマンドラインでの使用が制限 されていません。また htsearch が CGI スクリプトとして実行される場合も、 URL の一部として与えられたこのようなオプションを、そのまま受け入れて しまいます。その結果リモートの攻撃者は、ウェブサーバが読み取り権限を持つ あらゆるファイルを設定ファイルとして使用させるようなリクエストを htsearch へ与える事が可能になります。 The htsearch port is not installed by default, nor is it "part of FreeBSD" as such: it is part of the FreeBSD ports collection, which contains over 6000 third-party applications in a ready-to-install format. The ports collection shipped with FreeBSD 4.4 contains this problem since it was discovered after the release. htsearch の port はデフォルトではインストールされていませんし、 "FreeBSD の一部" でもありません。それは 6000 以上のサードパーティ製 のアプリケーションをすぐにインストールできるフォーマットで収録した FreeBSD ports collection の一部です。FreeBSD 4.4 のリリース後にこの 問題が発見されたため、4.4 と一緒にリリースされた ports collection にはこの問題があります。 FreeBSD makes no claim about the security of these third-party applications, although an effort is underway to provide a security audit of the most security-critical ports. FreeBSD は、このようなサードパーティ製のアプリケーションのセキュリ ティについて、何か主張するということはありません。しかし、システムの セキュリティに大きな影響を与える ports については、セキュリティ監査を 提供するよう努力を続けています。 III. 影響範囲 - Impact A remote attacker may use htsearch as a kind of denial-of-service attack by causing it to read a never-ending special file such as `/dev/null'. リモートの攻撃者は、設定ファイルとして `/dev/null' のような無限長の スペシャルファイルを読み込ませることにより、htsearch を利用した サービス拒否攻撃を引き起こすことができます。 More seriously, if the attacker has a local account or can otherwise create a file on the target system (such as via anonymous FTP upload or Samba), then he can remotely read any file on the target system for which the webserver has sufficient privilege. 攻撃者が目標のシステム上にローカルアカウントを持っている場合や、anonymous FTP や Samba を経由してファイルを作成できる場合はより深刻です。この場合、 攻撃者はリモートから目標のシステム上のウェブサーバが読み取り権限を持っ ているあらゆるファイルを読むことができてしまいます。 (訳註: htdig の設定ファイルでは、検索結果を表示する際にヘッダやフッタと して使用する HTML ファイルを指定できます。通常の HTML ファイルの代わりに 読み出そうとするファイルのパスを定義した設定ファイルを作成することができ れば、これを htsearch に読み込ませ、指定したファイルの内容をブラウザ上に 表示させることができます) IV. 回避方法 - Workaround 1) Deinstall the htdig port/package if you have it installed. 1) htdig の port や package をインストールしている場合は、これを削除 します。 V. 解決法 - Solution (訳注: 以下のいずれかを実行してください) 1) Upgrade your entire ports collection and rebuild the htdig port. 1) ports コレクション全体をアップグレードし、htdig の port をリビルド します。 2) Deinstall the old package and install a new package dated after the correction date, obtained from the following directories: 2) 古い package を削除し、以下の場所から入手した修正日以降の新しい package をインストールします。 [i386] ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/textproc/htdig-3.1.5_1.tgz ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/textproc/htdig-3.1.5_1.tgz [alpha] Packages are not automatically generated for the alpha architecture at this time due to lack of build resources. package をビルドするためのリソースが不足しているため、現時点では alpha アーキテクチャ用 package の自動生成は行っていません。 3) Download a new port skeleton for the htdig port from: 3) 以下から htdig の port 用の新しい port スケルトンをダウンロードします: http://www.freebsd.org/ports/ and use it to rebuild the port. そして、これを使って port をリビルドします。 4) Use the portcheckout utility to automate option (3) above. The portcheckout port is available in /usr/ports/devel/portcheckout or the package can be obtained from: 4) 上記の選択肢 (3) の作業を自動化するため、portcheckout ユーティリ ティを使用します。portcheckout の port は /usr/ports/devel/portcheckout で 利用できるほか、以下の場所から package を入手することもできます: 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 collection で修正されたファイルのリビジョン番号です。 Path Revision - ------------------------------------------------------------------------- ports/textproc/htdig/Makefile 1.20 ports/textproc/htdig/file/patch-htsearch_cc 1.1 - ------------------------------------------------------------------------- VII. 参考文献 - References