============================================================================= FreeBSD-SA-02:03 Security Advisory FreeBSD, Inc. トピック: mod_auth_pgsql の port が認証を回避される (mod_auth_pgsql port authentication bypass) カテゴリ: ports モジュール: mod_auth_pgsql 告知日: 2002-01-04 クレジット: RUS CERT 影響範囲: 修正日以前の Ports コレクション 修正日: 2001-10-02 11:33:49 UTC FreeBSD 固有: NO I. 背景 - Background mod_auth_pgsql is an Apache module which allows the Apache web server to use a PostgreSQL database for user and/or group authentication. mod_auth_pgsql は、Apache ウェブサーバでユーザやグループの認証に PostgreSQL データベースを利用できるようにする Apache のモジュールです。 II. 問題の詳細 - Problem Description The mod_auth_pgsql port, versions prior to mod_auth_pgsql-0.9.9, contain a vulnerability that may allow a remote user to cause arbitrary SQL code to be execute. mod_auth_pgsql constructs a SQL statement to be executed by the PostgreSQL server in order to lookup user information. The username given by the remote user is inserted into the SQL statement without any quoting or other safety checks. mod_auth_pgsql の mod_auth_pgsql-0.9.9 以前のバージョンの port には、 リモートのユーザが任意の SQL コードを実行できるという脆弱性があります。 mod_auth_pgsql は、ユーザ情報を参照するために PostgreSQL サーバで実行 される SQL のステートメントを作成します。リモートユーザから与えられた ユーザ名は、クオーティングやその他の安全性チェックを行わずに SQL のス テートメントに挿入されてしまいます。 The mod_auth_pgsql 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. mod_auth_pgsql の 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 remote user may insert arbitrary SQL code into the username during authentication, leading to several exploit opportunities. In particular, the attacker may cause mod_auth_pgsql to use a known fixed password hash for user verification, allowing him to authenticate as any user and obtain unauthorized access to web server data. リモートのユーザが認証時にユーザ名に任意の SQL コードを挿入し、攻撃を 行う機会を得る可能性があります。特に、攻撃者がユーザ確認時に mod_auth_pgsql に既知の固定パスワードハッシュを使用させる可能性があり ます。このとき、攻撃者は任意のユーザとして認証され、ウェブサーバ上の データに対する不正なアクセスを行うことができます。 IV. 回避方法 - Workaround 1) Deinstall the mod_auth_pgsql port/package if you have it installed. 1) mod_auth_pgsql の port や package をインストールしている場合は、これを 削除します。 V. 解決法 - Solution 1) Upgrade your entire ports collection and rebuild the port. 1) ports collection 全体をアップグレードし、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/www/mod_auth_pgsql-0.9.9.tgz ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current/www/mod_auth_pgsql-0.9.9.tgz [alpha] Packages are not automatically generated for the alpha architecture at this time due to lack of build resources. package をビルドするためのリソースが不足しているため、現時点では alpha アーキテクチャ用 package の自動生成は行っていません。 3) Download a new port skeleton for the mod_auth_pgsql port from: 3) 以下から新しい mod_auth_pgsql 用の 新しい 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/ports/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 $FreeBSD$ revision numbers of each file that was corrected in the FreeBSD source 以下は FreeBSD のソース中で修正された各ファイルの $FreeBSD$ リビジョン 番号のリストです。 Path Revision ------------------------------------------------------------------------- ports/www/mod_auth_pgsql/Makefile 1.3 ports/www/mod_auth_pgsql/distinfo 1.2 ------------------------------------------------------------------------- VII. 参考文献 - References