AWStats を使いたいなと思って、できれば日本語をちゃんと処理してくれるやつが良いなと思って探していたところ AWStats Ver.6.5完全日本語版のページ を発見。でも、これ入れたら、セキュリティホールが見つかったときのアップデートが大変だろうなぁ……

AWstats にはプラグインという機構があるらしいので、これを利用して日本語処理をうまくやっているのがないか探してみたけど、収穫なし。まだまだ検索キーワード文字のデコード等が難しい感じ。

表示上の文字化けを解消するだけなら、付属のdecodeUTFKeysプラグインで実現できそうなのですが、なかなかそうはいきません。

AWStatsの検索文字列の文字化けを解消

AWStatsの検索文字列の文字化けを解消 にはいくつかの問題点が解説されていて参考になる。

これは、AWStats 側にもっと良い形のプラグイン機構を実装をしてもらって、日本語用にプラグインを実装するのが良いのかなぁ(ソースコード読まず発言)。

AWStats 6.5 のセキュリティホール

AWStats 6.5 にはいくつかのセキュリティホールがあるらしい。今のところは AWStats を CGI として使っているとマズいということなのかな。関連するところをピックアップ。

Hole #2: Version 6.4 and 6.5 (vulnerable by the migrate parameter, not vulnerable to Lupper Worm):

When AWStats version is 6.4 or 6.5 is used as a CGI:
If the update of the stats via web front-end is allowed, a remote attacker can execute arbitrary code on the server using a specially crafted request involving the migrate parameter. Input starting with a pipe character ("|") leads to an insecure call to Perl's open function and the rest of the input being executed in a shell. The code is run in the context of the process running the AWStats CGI.

When AWStats version is 6.5 or lower and is used to build static pages:
If you use AWStats to build static pages, you are completely safe, whatever is the version of AWStats you use.

AWStats - Security news and annoucements
AWStats Ver.6.4もしくは6.5をCGIとして利用している場合:
Webからの更新処理が許可されている場合、マイグレーション用のパラメータに関連する特別に作りこまれたリクエストを悪用することにより、リモートの攻撃者が不正なコードをサーバ上で実行することができます。
パイプキャラクタ("|")を含む入力文字列がPerlのopen関数を安全ではない方法で呼び出し、結果として残りの入力文字列がシェルで実行されます。コードはAWStatsのCGIを実行しているプロセスのコンテクストで実行されます。

AWStatsのバージョンが6.5以下、もしくは静的にページを構築している場合:
AWStatsを利用して静的にページを構築している場合、AWStatsのバージョンを問わず、全く安全です。

管理人のMonoblog: [続報] AWStats Ver.6.5にXSSの脆弱性

- UNSECURED SYSTEMS -: AWStats 6.5.x multiple vuln. には具体的な例が載っている。

/awstats.pl?
hostfilter=&
hostfilterex=[XSS]&
output=allhosts&
config=unsecured-systems.com&
year=2006&
month=all
/awstats.pl?month=[CODE]

って、もしかしてこれがそのまま通っちゃうの? それはさすがに……

AWStats contains a flaw that allows a remote cross site scripting attack. This flaw exists because input passed to "config" paremeter in "awstats.pl" isn't properly sanitised before being returned to the user.
This could allow a user to create a specially crafted URL that would execute arbitrary code in a user's browser within the trust relationship between the browser and the server, leading to a loss of integrity.

Also doing XSS vuln. check attacker will get full path disclosure.

- UNSECURED SYSTEMS -: AWStats 6.5 vuln.
Cross-site scripting (XSS) vulnerability in awstats.pl in AWStats 6.5 and earlier allows remote attackers to inject arbitrary web script or HTML via the config parameter. NOTE: this might be the same core issue as CVE-2005-2732.

CVE-2006-1945
AWStatsは、細工されたHTTPリクエストをawstats.plスクリプトに送ることでセキュリティホールが存在する。この問題が悪用されると、リモートの攻撃者にシステム上で任意のコマンドを実行される可能性がある。
2006/05/09 登録

危険度:高
影響を受けるバージョン:6.5以前
影響を受ける環境:UNIX、Linux、Windows
回避策:6.6以降へのバージョンアップ

NetSecurity - セキュリティホール情報<2006/05/09>
AWStatsは、awstats.plスクリプトがユーザ入力を適切にチェックしていないことなどが原因で複数のセキュリティホールが存在する。この問題が悪用されると、リモートの攻撃者にクロスサイトスクリプティングを実行されたり機密情報を奪取される可能性がある。
2006/04/20 登録

危険度:中
影響を受けるバージョン:6.5
影響を受ける環境:UNIX、Linux、Windows
回避策:公表されていません

NetSecurity - セキュリティホール情報<2006/04/20>

Secunia - Advisories - AWStats Cross-Site Scripting and Full Path Disclosure

AWStats AWstats.PL Cross-Site Scripting Vulnerability

OS Reviews - AWStats: Flexible but Insecure

Secunia - Vulnerability Report - AWStats 6.x

追記: 2006-05-27

Debian GNU/Linux の場合。

Hendrik Weimer さんにより、多機能ウェブサーバログアナライザ awstats に特殊なウェブリクエストを与えることで、任意のコマンドの実行が出来ることが発見されました。

前安定版 (oldstable) ディストリビューション (woody) には、この問題の影響はありません。

安定版 (stable) ディストリビューション (sarge) では、この問題はバージョン6.4-1sarge2 で修正されています。

不安定版 (unstable) ディストリビューション (sid) では、この問題はバージョン 6.5-2 で修正されています。

直ぐに awstats パッケージをアップグレードすることを勧めます。

[debian-users:46551] [Translate] [SECURITY] [DSA 1058-1] New awstats packages fix arbitrary command execution

tags: zlashdot Internet AccessStatics

Posted by NI-Lab. (@nilab)