============================================================================= FreeBSD-SA-01:57 Security Advisory FreeBSD, Inc. トピック: sendmail がローカルから root 権限を奪取される 脆弱性を持つ(改訂版) カテゴリ: core モジュール: sendmail 告知日: 2001-08-27 改訂日: 2001-09-06 クレジット: Cade Cairnss 影響範囲: 2000年8月27日以降、修正日以前の FreeBSD 4-STABLE、 FreeBSD 4.1.1-RELEASE、4.2-RELEASE、4.3-RELEASE 修正日: 2001-08-21 01:36:37 UTC (FreeBSD 4.3-STABLE) 2001-08-22 05:34:11 UTC (RELENG_4_3) FreeBSD 固有: NO 0. 改訂履歴 - Revision History v1.0 2001-08-27 Initial release v1.1 2001-08-30 Update package to remove setuid bit from saved file; add non-openssl package; correct typo in package instructions; note that $Id$ not updated in RELENG_4_3. v1.2 2001-09-06 No changes to advisory, but the sendmail-crypto upgrade package had incorrect permissions for the sendmail binary. Update this package. v1.0 2001-08-27 初版 v1.1 2001-08-30 保存されたファイルから setuid ビットを除去するよう パッケージをアップデート; 非 openssl パッケージの 追加; パッケージ命令の誤植の修正; $Id$ が RELENG_4_3 ではアップデートされないことに注意 v1.2 2001-09-06 勧告についての修正はないが、sendmail-crypto アップグレード パッケージの sendmail バイナリのパーミッションが不適切 であった。このパッケージをアップデートした。 I. 背景 - Background sendmail is a mail transfer agent. sendmail はメール配送エージェントである。 II. 問題の詳細 - Problem Description Sendmail contains an input validation error which may lead to the execution of arbitrary code with elevated privileges by local users. Due to the improper use of signed integers in code responsible for the processing of debugging arguments, a local user may be able to supply the signed integer equivalent of a negative value supplied to sendmail's "trace vector". This may allow a local user to write data anywhere within a certain range of locations in process memory. Because the '-d' command-line switch is processed before the program drops its elevated privileges, the attacker may be able to cause arbitrary code to be executed with root privileges. sendmail には、ローカルユーザが権限を昇格する不正なコードを実行できて しまうという、入力の正当性検査のエラーがある。コード中のデバッグ用引数 の処理を行う部分で符号付き整数の扱いが不適当なため、ローカルユーザが sendmail の "trace vector" へ負の値を与えるのと等しい、符号付き整数を 与えることができる。これにより、ローカルユーザはプロセスメモリ内のある 領域のどこにでもデータを書き込むことができる。'-d' コマンドラインスイッ チは、プログラムが昇格した特権を落とす前に処理されるため、攻撃者が root 権限で任意のコードを実行できる可能性がある。 III. 影響範囲 - Impact Local users may be able to execute arbitrary code with root privileges. ローカルユーザは root 権限で任意のコードを実行できる可能性がある。 IV. 回避方法 - Workaround Do not allow untrusted users to execute the sendmail binary. 信頼できないユーザに sendmail バイナリの実行を許可しない。 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-STABEL や RELENG_4_3 セキュリティブランチにアップグレードする。 2) FreeBSD 4.x systems after August 27, 2000 and prior to the correction date: 2) 2000 年 8 月 27 日以降から修正日以前の FreeBSD 4.x システム: The following patch has been verified to apply to FreeBSD 4.1.1-RELEASE, 4.2-RELEASE, 4.3-RELEASE and 4-STABLE dated prior to the correction date. 以下のパッチは FreeBSD 4.1.1-RELEASE、4.2-RELEASE、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:57/sendmail.patch # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:57/sendmail.patch.asc Execute the following commands as root: root で以下のコマンドを実行する: # cd /usr/src # patch -p < /path/to/patch # cd /usr/src/lib/libsmutil # make depend && make all # cd /usr/src/usr.sbin/sendmail # make depend && make all install 3) FreeBSD 4.3-RELEASE systems: ** NOTE: The initial version of the upgrade package did not remove ** setuid root privileges from the saved copy of the sendmail binary. ** To correct this, deinstall the old package using the pkg_delete(1) ** command and install the corrected package as described below. ** 注意: 最初のバージョンのアップグレードパッケージは、保存した sendmail ** バイナリのコピーから root 権限の setuid を除去していなかった。これを修正 ** するには、pkg_delete(1) コマンドで古いパッケージを削除し、以下で示す ** ように修正済みのパッケージをインストールする。 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. インストール処理中に、パッケージによって上書きされるファイルのバックアップ コピーが作成される。パッケージが削除され、システムがパッチを当てる前の状態に 戻ると、これらのバックアップコピーが再度インストールされる。 Two versions of the package are available, depending on whether or not OpenSSL is installed. If the file /usr/lib/libcrypto.so exists on the local system, follow the directions in section 1a) below, otherwise follow the directions in section 1b). After adding the package, proceed with the instructions in section 2). OpenSSL がインストールされているかどうかによって、2つのバージョンの パッケージが利用可能である。もしローカルシステムに /usr/lib/libcrypto.so があればセクション 1a の指示に従い、それ以外はセクション 1b) の指示に従う。 パッケージを追加した後、セクション 2) の命令を実行する。 1a) If crypto is installed: 1a) crypto がインストールされている場合: # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-crypto-01.57.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-crypto-01.57.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使用して PGP シグネチャを確認する。 # pkg_add security-patch-sendmail-crypto-01.57.tgz 1b) If crypto is not installed: 1b) crypto がインストールされていない場合: # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-nocrypto-01.57.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:57/security-patch-sendmail-nocrypto-01.57.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使用して PGP シグネチャを確認する。 # pkg_add security-patch-sendmail-nocrypto-01.57.tgz 2) Restart sendmail after applying the patch by executing the following commands as root: 2) パッチの適用後 root で以下のコマンドを実行し、sendmail を再起動する。 # killall sendmail # /usr/sbin/sendmail -bd -q30m The flags to sendmail may need to be adjusted as required for the local system configuration. ローカルシステムの設定の要求によっては、sendmail のフラグを調整する必要 がある。 VI. 修正の詳細 - Correction details The following is the sendmail $Id$ revision number of the file that was corrected for the supported branches of FreeBSD. The $Id$ revision number of the installed source can be examined using the ident(1) command. Note that the $Id$ tag was not updated on the RELENG_4_3 branch because a newer vendor release of sendmail was not imported, instead only this vulnerability was patched. 以下は、FreeBSD のサポートブランチへの修正が行われたファイルの sendmail $Id$ リビジョン番号である。インストールされているソースの $Id$ リビジョン 番号は、ident(1) コマンドを使って調べられる。RELENG_4_3 ブランチでは、 sendmail の新しいベンダリリースがインポートされず、代わりにこの脆弱性に のみパッチがあてられるため、$Id$ タグはアップデートされないことに注意せよ。 Revision Path 8.20.22.4 src/contrib/sendmail/src/trace.c VII. 参考文献 - References