============================================================================= FreeBSD-SA-02:02 Security Advisory FreeBSD, Inc. トピック: pw(8) のレースコンディションが master.passwd を漏洩させる (pw(8) race condition may allow disclosure of master.passwd) カテゴリ: core モジュール: pw 告知日: 2002-01-04 クレジット: ryan beasley 影響範囲: 4.5-RELEASE 以前の全てのリリース 修正日以前の 4.4-STABLE 修正日: 2001-12-21 15:21:32 UTC (4.4-STABLE aka RELENG_4) 2001-12-21 15:22:55 UTC (4.4-RELEASEp1 aka RELENG_4_4) 2001-12-21 15:23:04 UTC (4.3-RELEASEp21 aka RELENG_4_3) FreeBSD 固有: YES I. 背景 - Background The pw(8) utility is used to create, remove, modify, and display system users and groups. pw(8) は、システム上のユーザやグループの、作成、削除、修正、および情報の 表示を行うユーティリティです。 II. 問題の詳細 - Problem Description When creating, removing, or modifying system users, the pw utility modifies the system password file `/etc/master.passwd'. This file contains the users' encrypted passwords and is normally only readable by root. During the modification, a temporary copy of the file is created. However, this temporary file is mistakenly created with permissions that allow it to be read by any user. システムのユーザの作成、消去、修正を行う際、pw ユーティリティは システムのパスワードファイル `/etc/master.passwd' を変更します。 このファイルには各ユーザの暗号化されたパスワードが含まれており、 通常は root ユーザしか読むことができないようになっています。この ファイルを修正する際、pw ユーティリティはこのファイルの一時的な コピーを作成します。ところが、このテンポラリファイルは誤ったパーミッ ション設定で作成されてしまうため、誰でも読むことができてしまいます。 III. 影響範囲 - Impact A local attacker can read the temporary file created by pw(8) and use the encrypted passwords to conduct an off-line dictionary attack. A successful attack would result in the recovery of one or more passwords. Because the temporary file is short-lived (it is removed almost immediately after creation), this can be difficult to exploit: an attacker must `race' to read the file before it is removed. ローカルの攻撃者は、pw(8) が作成したテンポラリファイルを読み、そこで 入手した暗号化されたパスワードを、オフラインの辞書攻撃に利用することが 可能です。攻撃が成功すると、一つ以上のパスワードが復元されます。テンポ ラリファイルは短時間しか存在しない(ほとんどの場合、作成されてすぐ削除 されます)ため、これを攻撃に利用するのは困難です。攻撃者は、テンポラリ ファイルが削除される前にそれを読む、という `レース' をしなければなり ません。 IV. 回避方法 - Workaround 1) Do not use pw(8) to create, remove, or modify system users. 1) システムのユーザを作成、削除、修正する際、pw(8) を使用しない ようにします。 V. 解決法 - Solution One of the following: 以下のいずれかを実行してください: 1) Upgrade your vulnerable FreeBSD system to 4-STABLE (RELENG_4), the 4.4-RELEASE security-fix branch (RELENG_4_4), or the 4.3-RELEASE security-fix branch (RELENG_4_3), dated after the correction date. 1) 脆弱性のある FreeBSD システムを、4-STABLE (RELENG_4)、4.4-RELEASE セキュリティ修正ブランチ (RELENG_4_4)、および 4.3-RELEASE セキュリティ 修正ブランチ (RELENG_4_3) の、それぞれ修正日以降のバージョンにアップ グレードします。 2) FreeBSD 4.x systems prior to the correction date: 2) 修正日以前の FreeBSD 4.x システムの場合: The following patch has been verified to apply to FreeBSD 4.3-RELEASE, 4.4-RELEASE, and 4-STABLE dated prior to the correction date. This patch may or may not apply to older, unsupported releases of FreeBSD. 以下のパッチは、FreBSD 4.3-RLEASE、4.4-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 ユーティリティを 使って署名を確認します。 ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-02:02/pw.patch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-02:02/pw.patch.asc Execute the following commands as root: root 権限で以下のコマンドを実行します: # cd /usr/src # patch < /path/to/patch # cd /usr/src/usr.sbin/pw # make depend && make all install VI. 修正の詳細 - Correction details The following list contains the $FreeBSD$ revision numbers of each file that was corrected in the FreeBSD source 以下は FreeBSD のソース中で修正された各ファイルの $FreeBSD$ リビジョン 番号のリストです。 Path Revision Branch ------------------------------------------------------------------------- src/usr.sbin/pw/pwupd.c HEAD (CURRENT) 1.18 RELENG_4 (4-STABLE) 1.12.2.4 RELENG_4_4 (4.4-RELEASE security branch) 1.12.2.3.4.1 RELENG_4_3 (4.3-RELEASE security branch) 1.12.2.3.2.1 -------------------------------------------------------------------------