Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unofficial patch of webalizer-2.01-10 to fix buffer overflow in User-Agent processing module

2 views
Skip to first unread message

Hiroshi

unread,
Feb 10, 2006, 8:49:52 AM2/10/06
to
久保です。

Apache httpd や squid キャッシュサーバーのログを解析するソフトウェア
webalizer-2.01-10 で Apache httpd の combined 形式のログを
処理する際、webalizer.conf の設定で

MangleAgents 1

とすると、次のような User-Agent がログに書かれている場合に
バッファオーバーフローが起きました。

Nokia6820/2.0 (4.83) Profile/MIDP-1.0 Configuration/CLDC-1.0
(compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)

# 二行に分けましたが実際は一行です。

現象は、 GNU/Linux で確認しました。
これを(とりあえず)修正するパッチを投稿します。

----------8<--------------------8<----------
--- webalizer.c.orig Wed Feb 8 12:14:56 2006
+++ webalizer.c Wed Feb 8 14:18:07 2006
@@ -806,11 +806,11 @@
{
/* Level 1 - try to get OS */
cp1=strstr(str,")");
- if (cp1!=NULL)
+ if (cp1!=NULL && cp1 >= cp2+2)
{
*cp2++=' ';
*cp2++='(';
- while (*cp1!=';'&&*cp1!='('&&cp1!=str) cp1--;
+ while (*cp1!=';'&&*cp1!='('&&cp1!=str && cp1>cp2) cp1--;
if (cp1!=str&&*cp1!='\0') cp1++;
while (*cp1==' '&&*cp1!='\0') cp1++;
while (*cp1!=')'&&*cp1!='\0') *cp2++=*cp1++;

----------8<--------------------8<----------


webalizer-2.01-10 のソースファイルを展開したディレクトリで、
patch コマンドで適用します。

参考: webalizer 本家
http://www.mrunix.net/webalizer/

# 更新されてないし、作者にメールしても今のところ連絡してもなしの
つぶてです…。
---
久保博

0 new messages