============================================================================= FreeBSD-SA-01:62 Security Advisory FreeBSD, Inc. トピック: UUCP がローカルの root 奪取を許す カテゴリ: core モジュール: uucp 告知日: 2001-10-08 クレジット: zen-parse@gmx.net 影響範囲: 4.4 以前にリリースされた全てのバージョンの 4.x 修正日以前の FreeBSD 4.3-STABLE 修正日: 2001-09-10 20:22:57 UTC (FreeBSD 4.3-STABLE) 2001-09-10 22:30:28 UTC (RELENG_4_3) FreeBSD 固有: NO I. 背景 - Background Taylor UUCP is an implementation of the Unix-to-Unix Copy Protocol, a protocol sometimes used for mail delivery on systems where permanent IP connectivity to the internet is not available. Taylor UUCP は、インターネットへの固定 IP 接続ができない場所のシステムで メールの配送にときどき使われる Unix-to-Unix Copy Protocol の実装の一つである。 II. 問題の詳細 - Problem Description The UUCP suite of utilities allow a user-specified configuration file to be given on the command-line. This configuration file is incorrectly processed by the setuid uucp and/or setgid dialer UUCP utilities while running as the uucp user and/or dialer group, and allows unprivileged local users to execute arbitrary commands as the uucp user and/or dialer group. UUCP ユーティリティのスイートは、コマンドラインでユーザ指定の設定ファイル を与えることができる。この設定ファイルは、setuid uucp や (and/or) setgid dialer された UUCP ユーティリティが uucp ユーザや (and/or) dialer グループで 動作している間に不正確に処理され、特権のないローカルユーザが uucp ユーザや (and/or) dialer グループで任意のコマンドを実行することを許してしまう。 Since the uucp user owns most of the UUCP binaries (this is required for UUCP to be able to write to its spool directory during normal operation, by virtue of being setuid) the attacker can replace these binaries with trojaned versions which execute arbitrary commands as the user which runs them. The uustat binary is run as root by default during the daily maintenance scripts. uucp ユーザは UUCP バイナリのほとんどを所有しているため(これは、UUCP が setuid によって通常の処理中にスプールディレクトリに書き込めるようにする ために必要である)、攻撃者はこれらのバイナリを、そのコマンドを実行する ユーザとして任意のコマンドを実行するトロイの木馬バージョンに置き換える ことができる。uustat バイナリは、毎日のメンテナンススクリプトの中で デフォルトで root 権限で実行される。 All versions of FreeBSD 4.x prior to the correction date including 4.3-RELEASE are vulnerable to this problem, but it was corrected prior to the release of FreeBSD 4.4-RELEASE. 4.3-RELEASE を含む修正日以前の全てのバージョンの FreeBSD 4.x が、この問題 に対して脆弱である。しかし、この問題は FreeBSD 4.4-RELEASE のリリース前に 修正された。 III. 影響範囲 - Impact Unprivileged local users can overwrite the uustat binary, which is executed as root by the daily system maintenance scripts. This allows them to execute arbitrary commands as root the next time the daily maintenance scripts are run. 特権の無いローカルユーザが、デイリーのシステムメンテナンススクリプトに よって root 権限で実行される uustat バイナリを上書きできる。これは、 次にデイリーメンテナンススクリプトが実行されるとき、ローカルユーザが 任意のコマンドを root 権限で実行することを許すことになる。 IV. 回避方法 - Workaround One or more of the following: 以下のいずれかの方法: 1) Set the noschg flag on all binaries owned by the uucp user: 1) uucp ユーザが所有する全てのバイナリに noschg フラグをセットする: # chflags schg /usr/bin/cu /usr/bin/uucp /usr/bin/uuname \ /usr/bin/uustat /usr/bin/uux /usr/bin/tip /usr/libexec/uucp/uucico \ /usr/libexec/uucp/uuxqt 2) Remove the above binaries from the system, if UUCP is not in use. 2) もし UUCP を使用していなければ、上記のバイナリをシステムがら削除する。 3) Disable the daily UUCP maintenance tasks by adding the following lines to /etc/periodic.conf: 3) 以下の行を /etc/periodic.conf に追加し、デイリーの UUCP メンテナンス タスクを無効にする。 # 340.uucp daily_uuclean_enable="NO" # Run uuclean.daily # 410.status-uucp daily_status_uucp_enable="NO" # Check uucp status # 300.uucp weekly_uucp_enable="NO" # Clean uucp weekly V. 解決法 - Solution We recommend that UUCP be removed entirely from systems containing untrusted users: to remove UUCP, refer to the directions in section IV above. Compiling the UUCP binaries when rebuilding the FreeBSD system can be prevented by adding the following line to /etc/make.conf: 信用できないユーザのいるシステムから UUCP を全て削除することを勧める: UUCP を削除するには、上のセクション IV を参照すること。以下の行を /etc/make.conf に追加する事で、FreeBSD システムの再構築の際に UUCP バイナリがコンパイルされるのを防ぐことができる。 NOUUCP=true 1) Upgrade your vulnerable FreeBSD system to 4.4-RELEASE, 4.4-STABLE or the RELENG_4_3 security branch dated after the respective correction dates. 1) 脆弱性のある FreeBSD システムを 4.4-RELEASE や、それぞれの修正日 以降の 4.4-STABLE、RELENG_4_3 セキュリティブランチへアップグレードする。 2) To patch your present system: download the relevant patch from the below location, and execute the following commands as root: 2) 現在のシステムにパッチを当てる: 以下の場所から適切なパッチをダウン ロードし、root で以下のコマンドを実行する: [FreeBSD 4.3] # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-01:62/uucp.patch # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-01:62/uucp.patch.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 # cd /usr/src # patch -p < /path/to/patch # make depend && make all install 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:62/security-patch-uucp-01.62.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:62/security-patch-uucp-01.62.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-uucp-01.62.tgz VI. 修正の詳細 - Correction details The following is the $FreeBSD$ revision number of the file that was corrected for the supported branches of FreeBSD. The $FreeBSD$ revision number of the installed source can be examined using the ident(1) command. The patch provided above does not cause these revision numbers to be updated. 以下は FreeBSD のサポートされているブランチ向けに修正されたファイルの $FreeBSD$ リビジョン番号である。インストールされているソースの $FreeBSD$ リビジョン番号は ident(1) コマンドを使って調べることができる。上で提供 されているパッチは、このリビジョン番号をアップデートしない。 [FreeBSD 4.3-STABLE] Revision Path [RELENG_4_3] Revision Path 1.8.4.1 src/gnu/libexec/uucp/cu/Makefile 1.6.4.1 src/gnu/libexec/uucp/uucp/Makefile 1.5.4.1 src/gnu/libexec/uucp/uuname/Makefile 1.5.4.1 src/gnu/libexec/uucp/uustat/Makefile 1.6.4.1 src/gnu/libexec/uucp/uux/Makefile 1.10.8.1 src/usr.bin/tip/tip/Makefile 1.3.2.2.2.1 src/etc/periodic/daily/410.status-uucp VII. 参考文献 - References