FreeBSD セキュリティ勧告 日本語版 ============================================================================= FreeBSD-SA-01:59 (2001-09-06) * rmuser contains a race condition exposing /etc/master.passwd [REVISED] ============================================================================= このメールは, announce-jp に流れた Subject: ANNOUNCE: FreeBSD Security Advisory FreeBSD-SA-01:59.rmuser [REVISED] From: FreeBSD Security Advisories Date: Thu, 6 Sep 2001 14:35:32 -0700 (PDT) Message-Id: <200109062135.f86LZWu77676@freefall.freebsd.org> X-Sequence: announce-jp 822 を日本語訳したものです. 原文は PGP 署名されていますが, この日本語訳は PGP 署名されていません. 修正パッチ等の内容が改ざんされていないことを確認するために PGP 署名の チェックを行なうには, 原文を参照してください. 日本語訳および, ミラーサイト利用の詳細については, 文末の「A. FreeBSD セキュリティ勧告 日本語版について」をご覧ください. [翻訳者: 佐藤 広生 ] --(ここから) ============================================================================= FreeBSD-SA-01:59 Security Advisory FreeBSD, Inc. トピック: rmuser における /etc/master.passwd 漏洩の危険性 (rmuser contains a race condition exposing /etc/master.passwd [REVISED]) 分類: 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 初版公開 v1.1 2001-09-06 Update patch. Update correction times. Update upgrade package as a result. 修正パッチ, 修正日時の更新. それにともなうアップグレードパッケージの更新. 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 ファイルとそれに対応するデータベースファイル /etc/spwd.db の両方を更新する必要があります. しかし rmuser スクリプトは 安全でない umask 値を使って新しい master.passwd ファイルを作成し, chmod を使って許可属性を 0600 に変更する, という正しくない手順で これを行なっていました. そのためファイルが作成される時刻と 許可属性が変更される時刻との間, master.passwd ファイルが すべてのユーザから読める状態になります. 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 のリリース前に 修正されたため, 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 のコピーが すべてのユーザから読める状態になります. このファイルを読むことができる ローカルの攻撃者は, この /etc/master.passwd のコピーから暗号化された パスワードハッシュを抽出することが可能です. この情報は, 攻撃者が オフラインで辞書攻撃を加えてローカルシステム上にあるユーザアカウントの 平文パスワードを獲得し, さらにローカルシステムの root 権限などの 高い権限を不正に獲得するために使用される可能性があります. IV. 回避方法 - Workaround Use the pw(8) utility to remove users instead of rmuser. - "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 ユーザを削除する場合は, rmuser の代わりに pw(8) を使ってください. - "pw userdel <ユーザ名>" は /etc/passwd, /etc/master.passwd, および /etc/group からユーザを削除します. - "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) 弱点を持った FreeBSD システムを修正日以降の FreeBSD 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 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 システムの場合: 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 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 リビジョン番号 パス名 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 リビジョン番号 パス名 1.8.2.2.2.2 src/usr.sbin/rmuser.perl A. FreeBSD セキュリティ勧告 日本語版について 日本語訳は FreeBSD 日本語ドキュメンテーションプロジェクト (doc-jp) が 参考のために提供するものです. 過去の日本語版セキュリティ勧告は http://www.FreeBSD.org/ja/security/ にまとめられています. ただし, 翻訳者および doc-jp は, その内容についていかなる保証も いたしませんのでご注意ください. 日本語訳についてのご意見, ご要望, お問い合わせ等は doc-jp@jp.FreeBSD.org までお願いします. この勧告の中で紹介されている WWW サイト http://www.FreeBSD.org/ および FTP サイト ftp://ftp.FreeBSD.org/ には, 日本のミラーサイトが存在します. ネットワークの混雑を緩和するため, まずはミラーサイトの利用を 考慮するようお願いします. 日本のミラーサイトを利用するには, http://www.FreeBSD.org/ を http://www.jp.FreeBSD.org/www.freebsd.org/ に, ftp://ftp.FreeBSD.org/ を ftp://ftp.jp.FreeBSD.org/ に, それぞれ置き換えてください. 他の地域を含む, ミラーサイトに関する詳細は, http://www.FreeBSD.org/handbook/mirror.html (英文) http://www.FreeBSD.org/ja/handbook/mirror.html (日本語訳) にまとめられています. $hrs: announce-jp/FreeBSD-SA/01:59,v 1.6 2001/09/24 19:07:01 hrs Exp $