============================================================================= FreeBSD-SA-01:53 Security Advisory FreeBSD, Inc. トピック: ipfw の P2P インタフェースにおける `me' キーワードが リモートアドレスにマッチしてしまう カテゴリ: core モジュール: ipfw 告知日: 2001-08-17 クレジット: Igor M Podlesny 影響範囲: 2001-02-20 以降かつ修正日以降の FreeBSD 4-STABLE FreeBSD 4.3-RELEASE 修正日: 2001-07-17 10:50:01 UTC (FreeBSD 4.3-STABLE) 2001-07-18 06:56:23 UTC (RELENG_4_3) FreeBSD 固有: YES I. Background I. 背景 - Background ipfw is a system facility which allows IP packet filtering, redirecting, and traffic accounting. ipfw `me' rules are filter rules that specify a source or destination address of `me', intended to match any IP address configured on a local interface. ipfw は IP パケットフィルタ、リダイレクト、トラフィック管理を行える システム機能である。ipfw の `me' は、ローカルインタフェースに設定された 全ての IP アドレスにマッチし、送信元/宛先のアドレスが「自分自身」 であることを指定するフィルタルールである。 II. 問題の詳細 - Problem Description A flaw in the implementation of the ipfw `me' rules when used in conjunction with point-to-point interfaces results in filter rules which match the remote IP address of the point-to-point interface in addition to the intended local IP address. ipfw の `me' ルールの実装の問題点は、フィルタルールの中で point-to-point インタフェースと同時に使用されたとき、意図したローカル IP アドレスに 加えて、point-to-point インタフェースのリモート IP アドレスにもマッチ してしまうことである。 III. 影響範囲 - Impact IP datagrams with a source or destination IP address of a remote point-to-point link may be handled in a way unintended by the system administrator. リモート point-to-point リンクの IP アドレスを送信元や宛先に持つ IP データグラムは、ある意味システム管理者が意図しない方法で扱われる可能性 がある。 For example, given an interface such as 例えば、このようなインタフェースと tun0: flags=8051 mtu 1500 inet 1.1.1.1 --> 2.2.2.2 netmask 0xff000000 and this ipfw rule: この ipfw ルールが与えられると: 00010 allow ip from me to any packets with a source address of 2.2.2.2 would be allowed to pass when the administrator may have reasonably expected it not to match this rule. 管理者がこのルールにマッチしないことを合理的に期待しているとき、送信元 アドレスに 2.2.2.2 を持つパケットが通過を許可されてしまう。 IV. 回避方法 - Workaround Do not use ipfw `me' rules. Rewrite any existing `me' rules to use explicit IP addresses. ipfw の `me' ルールを使用しない。既に存在する `me' ルールを明示的な IP アドレスを用いて書き換える。 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 4.x systems prior to the correction date: 2) 修正日以前の FreeBSD 4.x システム: The following patches have been verified to apply to FreeBSD 4.3-RELEASE and 4-STABLE dated prior to the correction date. 以下のパッチは FreeBSD 4.3-RELEASE や修正日以前の 4-STABLE への適用が 確認されている。 Download the patch and the detached PGP signature from the following locations, and verify the signature using your PGP utility. 以下の場所からパッチと PGP シグネチャをダウンロードし、PGP ユーティリティ を使ってシグネチャを確認する。 # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:53/ipfw.patch # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:53/ipfw.patch.asc # cd /usr/src # patch -p < /path/to/patch # install -c -m 0444 -o root -g wheel /usr/src/sys/netinet/in_var.h /usr/include/netinet/ # cd /usr/src/sbin/ipfw # make depend && make all install The following steps will be different depending upon whether your system has ipfw compiled into the kernel or is using the ipfw KLD. If the output of `kldstat' includes `ipfw.ko', then you are using the KLD and should follow the directions listed in (2a) below. Otherwise, if your kernel configuration file contains the line `options IPFIREWALL', you should follow the directions listed in (2b) below. 以下のステップは、あなたのシステムで ipfw がカーネルに組み込まれているか ipfw KLD を使用しているかによって異なる。`kldstat' の出力に `ipfw.ko' が 含まれていれ KLD を使用しており、以下の (2a) に載っている指示に従う。 それ以外の場合で、カーネルコンフィグファイルに `options IPFIREWALL' という行が含まれていれば、以下の (2b) に載っている指示に従う。 2a) Execute the following commands as root: 2a) root で以下のコマンドを実行する: # cd /usr/src/sys/modules/ipfw # make depend && make all install 2b) Rebuild and reinstall your kernel as described in 2b) 以下で説明されているようにして、カーネルの再構築と再インストールを 行う。 http://www.freebsd.org/handbook/kernelconfig.html In either case 2a) or 2b), you must reboot your system to load the new module or kernel. 2a) と 2b) どちらの場合も、新しいモジュールやカーネルをロードするために システムを再起動しなければならない。 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. インストール処理中に、パッケージによって上書きされるファイルのバック アップコピーが作成される。パッケージが削除されると、バックアップ コピーが再インストールされ、システムをパッチを当てる前の状態に戻す。 # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:53/security-patch-ipfw-01.53.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:53/security-patch-ipfw-01.53.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-ipfw-01:53.tgz Restart your system after applying the patch. パッチの適用後、システムを再起動させる。 VI. 修正の詳細 - Correction details The following list contains the $FreeBSD$ revision numbers of each file that was corrected, for the supported branches of FreeBSD. The $FreeBSD$ revision of installed sources can be examined using the ident(1) command. 以下のリストは、FreeBSD のサポートされているブランチ向けに修正された個々の ファイルの $FreeBSD$ リビジョン番号を含んでいる。インストールされている ソースの $FreeBSD$ リビジョンは、ident(1) コマンドを使って調べられる。 [FreeBSD 4.3-STABLE] Revision Path 1.33.4.1 src/sys/netinet/in_var.h [RELENG_4_3] Revision Path 1.33.2.2 src/sys/netinet/in_var.h VII. 参考文献 - References