============================================================================= FreeBSD-SA-01:58 Security Advisory FreeBSD, Inc. トピック: lpd がリモートから root 権限を獲得される脆弱性を持つ カテゴリ: core モジュール: lpd 告知日: 2001-08-30 クレジット: ISS X-Force 影響範囲: リリースされている全てのバージョンの FreeBSD 4.x、3.x 修正日以前の FreeBSD 4.3-STABLE、3.5.1-STABLE 修正日: 2001-08-30 09:27:41 UTC (FreeBSD 4.3-STABLE) 2001-08-30 09:28:35 UTC (RELENG_4_3) 2001-08-30 09:46:44 UTC (FreeBSD 3.5.1-STABLE) FreeBSD 固有: NO I. 背景 - Background lpd is the BSD line printer daemon used to print local and remote print jobs. lpd はローカルやリモートから印刷ジョブを印刷するために使用する BSD ラインプリンタデーモンである。 II. 問題の詳細 - Problem Description Users on the local machine or on remote systems which are allowed to access the local line printer daemon may be able to cause a buffer overflow. By submitting a specially-crafted incomplete print job and subsequently requesting a display of the printer queue, a static buffer overflow may be triggered. This may cause arbitrary code to be executed on the local machine as root. ローカルラインプリンタデーモンへのアクセスが許可された、ローカルマシンや リモートシステム上のユーザは、バッファオーバーフローを引き起こすことが できる。特別に作成した不完全な印刷ジョブを提出し、その後プリンタキューの 表示をリクエストすることによって、静的なバッファオーバーフローが引き起こ される可能性がある。これによって、ローカルマシン上で root 権限で任意の コードが実行される可能性がある。 In order to remotely exploit this vulnerability, the remote machine must be given access to the local printer daemon via a hostname entry in /etc/hosts.lpd or /etc/hosts.equiv. lpd is not enabled on FreeBSD by default. この脆弱性をリモートから突くためには、リモートマシンが /etc/hosts.lpd や /etc/hosts.equiv のホスト名エントリによって、ローカルプリンタデーモンへの アクセス権が与えられなければならない。lpd は FreeBSD ではデフォルトでは 有効になっていない。 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 before the release. FreeBSD 4.3 を含む、修正日以前の全てのバージョンの FreeBSD にはこの問題 がある。FreeBSD 4.4 付属のベースシステムは、リリース前に修正されたため この問題を含んでいない。 III. 影響範囲 - Impact Users on the local machine and on remote systems which are allowed to connect to the local printer daemon may be able to trigger a buffer overflow causing arbitrary code to be executed on the local system as root. ローカルマシンや、ローカルプリンタデーモンへの接続が許可されたリモート システムのユーザは、バッファオーバーフローを引き起こし、ローカルシステム 上で root 権限で任意のコードを実行させることができる。 lpd is not enabled by default. If you have not enabled lpd, your system is not vulnerable. lpd はデフォルトでは有効になっていない。lpd を有効にしなければ システムは脆弱でない。 IV. 回避方法 - Workaround Disable lpd by executing the following command as root: root で以下のコマンドを実行し、lpd を無効にする: # killall lpd 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-STABLE や RELENG_4_3 セキュリティブランチにアップデートする。 2) FreeBSD 3.x, 4.x systems prior to the correction date: 2) 修正日以前の FreeBSD 3.x、4.x システム: The following patches have been verified to apply to FreeBSD 4.2-RELEASE, 4.3-RELEASE, 4.3-STABLE and 3.5.1-STABLE dated prior to the correction date. It may or may not apply to older, unsupported versions of FreeBSD. 以下のパッチは FreeBSD 4.2-RELEASE、4.3-RELEASE、修正日以前の 4.3-STABLE と 3.5.1-STABLE への適用を確認している。それ以前のサポートされていない バージョンの FreeBSD への適用は未確認である。 Download the relevant patch and the detached PGP signature from the following locations, and verify the signature using your PGP utility. 以下の場所から適切なパッチと PGP シグネチャをダウンロードし、PGP ユー ティリティを使ってシグネチャを確認する。 [FreeBSD 4.3-RELEASE, 4.3-STABLE] # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:58/lpd-4.3.patch # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:58/lpd-4.3.patch.asc [FreeBSD 4.2-RELEASE, 3.5.1-STABLE] # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:58/lpd-3.x-4.2.patch # fetch ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-01:58/lpd-3.x-4.2.patch.asc Execute the following commands as root: root で以下のコマンドを実行する: # cd /usr/src # patch -p < /path/to/patch # cd /usr/src/usr.sbin/lpr # 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:58/security-patch-lpd-01.58.tgz # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:58/security-patch-lpd-01.58.tgz.asc Verify the detached PGP signature using your PGP utility. PGP ユーティリティを使って PGP シグネチャを確認する。 # pkg_add security-patch-lpd-01.58.tgz Restart lpd after applying the patch by executing the following commands as root: root で以下のコマンドを実行し、パッチを適用済みの lpd を再起動する。 # killall lpd # /usr/sbin/lpd 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 1.15.2.8 src/usr.sbin/lpr/common_source/displayq.c [RELENG_4_3] Revision Path 1.15.2.3.2.1 src/usr.sbin/lpr/common_source/displayq.c [FreeBSD 3.5.1-STABLE] Revision Path 1.14.2.2 src/usr.sbin/lpr/common_source/displayq.c VII. 参考文献 - References