============================================================================= FreeBSD-SA-01:68 Security Advisory FreeBSD, Inc. トピック: xsane の port が安全でないテンポラリファイル ハンドリングを使用している (xsane port uses insecure temporary file handling) カテゴリ: ports モジュール: xsane 告知日: 2001-12-17 クレジット: Tim Waugh , michal@harddata.com 影響範囲: 修正日以前の Ports コレクション 修正日: 2001-12-14 01:58:36 UTC FreeBSD 固有: NO I. 背景 - Background The XSane application is a gtk based X11 front-end to the SANE (Scanner Access Now Easy) library used to interface with scanners. XSane will acquire images using devices such as scanners and cameras. XSane は、スキャナのインターフェイスに使われる SANE(Scanner Access Now Easy)ライブラリの、gtk ベースの X11 フロントエンドです。XSane は、 スキャナやカメラといったデバイスの画像をコンピュータ上に取り込みます。 II. 問題の詳細 - Problem Description XSane creates temporary files in /tmp during the process of scanning images and to communicate with SANE (the back-end application which actually performs the scans) during image preview and save. XSane は、イメージのプレビューや保存を行う際に SANE(実際のスキャンを行う バックエンドアプリケーション)と通信するため、スキャニング中に /tmp ディレ クトリにテンポラリファイルを作成します。 However XSane creates temporary files using mktemp(3), which can be easily predicted (see the BUGS section of the mktemp(3) man page). This makes XSane vulnerable to exploit, opening the opportunity for a user's files to be overwritten through a race condition. XSane は mktemp(3) を使ってテンポラリファイルを作成していますが、 このファイル名は簡単に予測できてしまいます(mktemp(3) の man page の BUGS セクションをご覧下さい)。そのため、レースコンディションを通じて ユーザファイルが上書きされる機会を作ってしまうため、XSane は攻撃に 対して脆弱になっています。 The xsane port is not installed by default, nor is it "part of FreeBSD" as such: it is part of the FreeBSD ports collection, which contains over 6000 third-party applications in a ready-to-install format. The ports collection shipped with FreeBSD 4.4 contains this problem since it was discovered after the release. xsane の port はデフォルトではインストールされていませんし、"FreeBSD の一部" でもありません。それは 6000 以上のサードパーティ製のアプリケー ションをすぐにインストールできるフォーマットで収録した FreeBSD ports collection の一部です。FreeBSD 4.4 のリリース後にこの問題が発見された ため、4.4 と一緒にリリースされた ports collection にはこの問題があります。 FreeBSD makes no claim about the security of these third-party applications, although an effort is underway to provide a security audit of the most security-critical ports. FreeBSD は、このようなサードパーティ製のアプリケーションのセキュリ ティについて、何か主張するということはありません。しかし、システムの セキュリティに大きな影響を与える ports については、セキュリティ監査を 提供するよう努力を続けています。 III. 影響範囲 - Impact A local user may be able to cause xsane (run by another user) to overwrite any file for which the latter user has sufficient privilege. While it is advisable to run XSane with a non-privileged user account, many users run it using the root account, increasing the risk. ローカルユーザは、他のユーザが実行している xsane を利用して、そのユーザ が書き込み権限を持っているファイルを上書きすることができる可能性があり ます。権限を持たないユーザのアカウントで XSane を実行することをお勧め します。もし、多くのユーザが root アカウントで XSane を実行している場合 は、そのリスクはずっと高くなります。 IV. 回避方法 - Workaround 1) Deinstall the xsane port/package if you have it installed. 1) xsane の port や package をインストールしている場合は、これを削除 します。 V. 解決法 - Solution (訳注: 以下のいずれかを実行してください) 1) Upgrade your entire ports collection and rebuild the port. 1) ports コレクション全体をアップグレードし、xsane の port をリビルド します。 2) Deinstall the old package and install a new package dated after the correction date, obtained from the following directories: 2) 古い package を削除し、以下の場所から入手した修正日以降の新しい package をインストールします。 [i386] ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/graphics/xsane-0.82.tgz ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/graphics/xsane-0.82.tgz [alpha] Packages are not automatically generated for the alpha architecture at this time due to lack of build resources. package をビルドするためのリソースが不足しているため、現時点では alpha アーキテクチャ用 package の自動生成は行っていません。 NOTE: It may be several days before updated packages are available. Be sure to check the file creation date on the package, because the version number of the software has not changed. 注意: 更新された package が利用できるようになるまで何日かかかる可能性が あります。ソフトウェアのバージョン番号は変わっていないので、必ずパッケー ジのファイル生成日を確認してください。 3) Download a new port skeleton for the xsane port from: 3) 以下から xsane の port 用の新しい port スケルトンをダウンロードします: http://www.freebsd.org/ports/ and use it to rebuild the port. そして、これを使って port をリビルドします。 4) Use the portcheckout utility to automate option (3) above. The portcheckout port is available in /usr/ports/devel/portcheckout or the package can be obtained from: 4) 上記の選択肢 (3) の作業を自動化するため、portcheckout ユーティリティ を使用します。portcheckout の port は /usr/pots/devel/portcheckout で 利用できるほか、以下の場所から package を入手することもできます: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/devel/portcheckout-2.0.tgz ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/devel/portcheckout-2.0.tgz VI. 修正の詳細 - Correction details The following list contains the revision numbers of each file that was corrected in the FreeBSD ports collection. 以下は FreeBSD ports コレクションで修正されたファイルのリビジョン番号の リストです。 Path Revision - ------------------------------------------------------------------------- ports/graphics/xsane/Makefile 1.30 ports/graphics/xsane/distinfo 1.20 ports/graphics/xsane/pkg-plist 1.18 - -------------------------------------------------------------------------