============================================================================= FreeBSD-SA-01:59 Security Advisory FreeBSD, Inc. トピック: rmuser が /etc/master.passwd を暴露する レースコンディションを持つ(改訂版) カテゴリ: core モジュール: rmuser 告知日: 2001-09-04 改訂日: 2001-09-06 クレジット: dynamo@harvard.net 影響範囲: FreeBSD 4.2-RELEASE, 4.3-RELEASE 修正日以前の FreeBSD 4.3-STABLE 修正日: 2001-08-01 20:26:37 UTC (4.3-STABLE) 2001-09-05 05:24:55 UTC (RELENG_4_3) FreeBSD 固有: Yes 0. 改訂履歴 - Revision History v1.0 2001-09-04 Initial release v1.1 2001-09-06 Update patch. Update correction times. Update upgrade package as a result. v1.0 2001-09-04 初版 v1.1 2001-09-06 パッチをアップデート。改訂時刻をアップデート。 結果としてアップグレードパッケージをアップデート。 I. 背景 - Background rmuser is a perl script used to completely remove users from a system. rmuser はシステムからユーザを完全に削除するために用いる perl スクリプト である。 II. 問題の詳細 - Problem Description When removing a user from the system with the rmuser utility, the /etc/master.passwd file and it's corresponding database /etc/spwd.db must be updated. The rmuser script was incorrectly doing this by creating a new master.passwd file with an unsafe umask and then using chmod to set its permissions to 0600. Between the time that the file was created and the time that its permissions were changed the file is world-readable. rmuser ユーティリティを用いてシステムからユーザを削除する際、 /etc/master.passwd ファイルと、関連するデータベース /detc/spwd.db が アップデートされなければならない。rmuser スクリプトは、安全でない umask 値で新しい master.passwd ファイルを作成し、それからパーミッションを 0600 にするため chmod を使うという、不正確な処理を行う。ファイルが 作成されてから、そのパーミッションが変更されるまでの間、そのファイルは world-readable になる。 This is only a minor security vulnerability since the rmuser command is only used infrequently on most systems, and the attack is highly timing-dependent. rmuser コマンドは、ほとんどのシステムでは滅多に使われず、またその 攻撃は非常にタイミングに依存しているため、セキュリティの脆弱性として の重要度は低い。 All versions of FreeBSD prior to the correction date including FreeBSD 4.3 contain this problem. The base system that will ship with FreeBSD 4.4 does not contain this problem since it was corrected prior to the release. FreeBSD 4.3 を含む、修正日以前の全てのバージョンの FreeBSD はこの問題を 含んでいる。リリース日以前に修正されたため、FreeBSD 4.4 と共にリリース するベースシステムにはこの問題は含まれていない。 III. 影響範囲 - Impact For a brief amount of time while running rmuser, a world-readable copy of /etc/master.passwd is available. A local attacker who reads this file can extract password hashes from the copy of /etc/master.passwd. This information could be used by attackers to escalate their privileges, possibly yielding root privileges on the local system, by mounting an offline dictionary attack in order to guess the plaintext passwords of the accounts on the local system. rmuser が動作している短い間、/etc/master.passwd の world-readable なコピーが利用できる。このファイルを読んだローカルの攻撃者は、 /etc/master.passwd のコピーからパスワードハッシュを解読できる。 この情報は、攻撃者が権限を昇格するために使うことが可能で、ローカル システム上のアカウントの平文パスワードを推測するためのオフライン 辞書攻撃に利用することで、ローカルシステムの root 権限を獲得する 可能性がある。 IV. 回避方法 - Workaround Use the pw(8) utility to remove users instead of rmuser. ユーザの削除に、rmuser の代わりに pw(8) ユーティリティを使用する。 - "pw userdel " will only remove the user from /etc/passwd, /etc/master.passwd and /etc/group - "pw -r userdel " will also remove the user's home dirrectory - "pw userdel " は /etc/passwd、 /etc/master.passwd、 /etc/gropu からユーザを削除する。 - "pw -r userdel " はユーザのホームディレクトリも削除 する。 V. 解決法 - Solution 1) Upgrade your vulnerable system to 4.3-STABLE or the RELENG_4_3 security branch, dated after the respective correction dates. Note that the initial correction dates did not include complete fixes for the rmuser utility, and sources dated before the updated correction date given in this advisory will not work. 1) 脆弱性のあるシステムを、それぞれの修正日以降の 4.3-STABLE や RELENG_4_3 セキュリティブランチにアップグレードする。最初の修正日のもの には、rmuser ユーティリティの完全な修正が含まれていないこと、そして この勧告に示される新しい修正日以前の日付のソースは動作しないことに 注意。 2) To patch your present system: download the relevant patch from the below location, and execute the following commands as root: 2) 現在のシステムにパッチを当てる: 以下の場所から適切なパッチをダウン ロードし、root で以下のコマンドを実行する: # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-01:59/rmuser.patch.v1.1 # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-01:59/rmuser.patch.v1.1.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 This patch has been verified to apply to FreeBSD 4.2-RELEASE and 4.3-RELEASE. It may or may not apply to older, unsupported releases of FreeBSD. このパッチは FreeBSD 4.2-RELEASE と 4.3-RELEASE への適用を確認している。 それより古いサポート外の FreeBSD のリリースの動作は不明である。 # cd /usr/src/usr.sbin/adduser # 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:59/security-patch-rmuser-01.59.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:59/security-patch-rmuser-01.59.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-rmuser-01.59.tgz VI. CVS リビジョン - CVS Revisions The following $FreeBSD$ CVS revision contain the fixes for this vulnerability. The $FreeBSD$ revision of installed sources can be examined using the ident(1) command. These revision IDs are not updated by applying the patch referenced above. この脆弱性の修正には以下の $FreeBSD$ CVS リビジョンが含まれる。 インストールされているソースの $FreeBSD$ リビジョンは、ident(1) コマンドで調べることができる。これらのリビジョン ID は、上で参照 されているパッチの適用ではアップデートされない。 [FreeBSD 4.3-STABLE] Revision Path 1.8.2.7 src/usr.sbin/rmuser.perl [RELENG_4_3] Revision Path 1.8.2.2.2.2 src/usr.sbin/rmuser.perl