============================================================================= FreeBSD-SA-01:66 Security Advisory FreeBSD, Inc. トピック: thttpd の port にリモートからの攻撃に対する脆弱性が存在する (thttpd port contains remotely vulnerability) カテゴリ: ports モジュール: thttpd 告知日: 2001-12-11 クレジット: GOBBLES SECURITY 影響範囲: 修正日以前の Ports コレクション 修正日: 2001-11-22 00:10:56 UTC FreeBSD 固有: no I. 背景 - Background thttpd is a simple, small, portable, fast, and secure HTTP server. thttpd は、シンプルで小さく、ポータブル、高速、セキュアという特徴を もった HTTP サーバです。 II. 問題の詳細 - Problem Description In auth_check(), there is an off-by-one error in computing the amount of memory needed for storing a NUL terminated string. Specifically, a stack buffer of 500 bytes is used to store a string of up to 501 bytes including the terminating NUL. NUL でターミネートされた文字列を格納するために必要なサイズのメモリを 出す際に、1バイト足りない値を算出してしまうというバグが auth_check() 関数に存在します。具体的にいうと、500 バイトのスタックバッファに、文字列 の終端を示す NUL を含めて 501 バイトまでの文字列を格納してしまいます。 III. 影響範囲 - Impact Due to the location of the affected buffer on the stack, this bug can be exploited using ``The poisoned NUL byte'' technique (see references). A remote attacker can hijack the thttpd process, obtaining whatever privileges it has. By default, the thttpd process runs as user `nobody'. このバグの影響を受けるバッファはスタック上にあるため、「汚染された NUL バイト(The poisoned NUL byte) 」テクニック(参考文献を参照してください) を使って攻撃することができます。リモートの攻撃者は thttpd プロセスを 乗っ取り、thttpd を動作させている権限を獲得することができます。デフォ ルトでは、thttpd プロセスは 'nobody' ユーザ権限で動作します。 IV. 回避方法 - Workaround 1) Deinstall the thttpd port/package if you have it installed. 1) thttpd をインストールしている場合は、port や package を削除します。 V. 解決法 - Solution 1) Upgrade your entire ports collection and rebuild the port. 1) ports コレクション全体をアップグレードし、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/www/thttpd-2.22.tgz ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/www/thttpd-2.22.tgz [alpha] Packages are not automatically generated for the alpha architecture at this time due to lack of build resources. パッケージをビルドするためのリソースが不足しているため、現時点では alpha アーキテクチャ用パッケージの自動生成はしていません。 3) Download a new port skeleton for the thttpd port from: 3) 以下から thttpd の 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 で 利用できるほか、以下の場所から入手することもできます。 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/www/thttpd/Makefile 1.23 ports/www/thttpd/distinfo 1.20 ports/www/thttpd/files/patch-fdwatch.c removed - ------------------------------------------------------------------------- VII. 参考文献 - References