Apache HTTP Server 出现严重安全漏洞
/ns/ld/softld/data/20020703042708.htm
涉及程序:
Apache 1.x
描述:
chunk encoding,是HTTP协议定义的用于接受web用户所提交数据的功能。当web用户提交数据后,web server需要为这些数据分配一个确定大小的缓冲区,但当提交的数据长度不确定的时候,客户端将通过与HTTP SERVER协商的机制创建一个数据块向web server提交数据。
Apache服务器缺省也提供了对块编码(chunked encoding)支持。Apache使用了一个有字符变量储存分块长度,同时分配了一个固定大小的堆栈缓冲区来储存分块数据。出于安全考虑,在将块数据拷贝到缓冲区之前,Apache会对块长度进行检查,如果块长度大于缓冲区长度,Apache将最多只拷贝缓冲区长度的数据,否则,则根据块长度进行数据拷贝。然而在进行上述检查时,没有将块长度转换为非字符型进行比较,因此,如果攻击者将块长度设置成一个负值,就会绕过上述安全检查,Apache会将一个超长(至少>0x80000000字节)的块数据拷贝到缓冲区中,这会造成一个缓冲区溢出。
对于这个错误,Windows版本1.3.24和Unix版本1.x,有相同的攻击原理。现在已经证实在Win32系统下, 远程攻击者可以利用这一漏洞执行任意代码。据报告称下列系统也可以成功的利用:
* Sun Solaris 6-8 (sparc/x86)
* FreeBSD 4.3-4.5 (x86)
* OpenBSD 2.6-3.1 (x86)
* Linux (GNU) 2.4 (x86)
对于Apache 2.0到2.0.36(含2.0.36),尽管存在同样的问题代码,但它会检测错误出现的条件并使子进程退出。
远程攻击者如果成功利用漏洞,可以修改web文件、发起拒绝服务和相关的,利用apache web server对系统的非法访问。
About this issue:
6月16日发布漏洞信息
6月18日发布第一个攻击脚本
6月25日发布第二个攻击脚本
6月29日发布apache蠕虫
==========================
受影响的程序:
Apache Group Apache 2.0.34-BETA win32
Apache Group Apache 2.0.32-BETA win32
Apache Group Apache 2.0.28-BETA win32
Apache Group Apache 1.3.9win32
Apache Group Apache 1.3.9
Apache Group Apache 1.3.7-dev
Apache Group Apache 1.3.6win32
Apache Group Apache 1.3.4
Apache Group Apache 1.3.3
Apache Group Apache 1.3.24win32
Apache Group Apache 1.3.24
Apache Group Apache 1.3.23win32
Apache Group Apache 1.3.23
Apache Group Apache 1.3.22win32
Apache Group Apache 1.3.22
Apache Group Apache 1.3.20win32
Apache Group Apache 1.3.20
Apache Group Apache 1.3.19win32
Apache Group Apache 1.3.19
Apache Group Apache 1.3.18win32
Apache Group Apache 1.3.18
Apache Group Apache 1.3.17win32
Apache Group Apache 1.3.17
Apache Group Apache 1.3.16win32
Apache Group Apache 1.3.15win32
Apache Group Apache 1.3.14win32
Apache Group Apache 1.3.14Mac
Apache Group Apache 1.3.14
Apache Group Apache 1.3.13win32
Apache Group Apache 1.3.12win32
Apache Group Apache 1.3.12
Apache Group Apache 1.3.11win32
Apache Group Apache 1.3.11
Apache Group Apache 1.3.1
Apache Group Apache 1.3
=========================================
不受影响程序:
Apache Group Apache 2.0.39
Apache Group Apache 1.3.26
=================================
解决方案:
正式解决方案:下载补丁程序:
=============================================================
Apache:
http://www.apache.org/dist/httpd/
=============================================================
slackware:
Updated Apache package for Slackware 8.0:
ftp://ftp.slackware.com/pub/slackware/slackware-8.0/patches/packages/apache.tgz
Updated Apache package for Slackware 8.1:
ftp://ftp.slackware.com/pub/slackware/slackware-8.1/slackware/n/apache-1.3.26-i386-1.tgz
Updated mod_ssl package for Slackware 8.0:
ftp://ftp.slackware.com/pub/slackware/slackware-8.0/patches/packages/mod_ssl.tgz
Updated mod_ssl package for Slackware 8.1:
ftp://ftp.slackware.com/pub/slackware/slackware-8.1/slackware/n/mod_ssl-2.8.9_1.3.26-i386-1.tgz
============================================================
OpenLinux:
ftp://ftp.caldera.com/pub/updates/OpenLinux/3.1.1/Server/current/RPMS
ftp://ftp.caldera.com/pub/updates/OpenLinux/3.1.1/Workstation/current/RPMS
=============================================================
Debian
------
Debian已经为此发布了一个安全公告(DSA-131-1)以及相应补丁:
DSA-131-1:Apache chunk handling vulnerability
链接:http://www.debian.org/security/2002/dsa-131
补丁下载:
Source archives:
http://security.debian.org/dists/stable/updates/main/source/apache_1.3.9-14.1.diff.gz
http://security.debian.org/dists/stable/updates/main/source/apache_1.3.9-14.1.dsc
http://security.debian.org/dists/stable/updates/main/source/apache_1.3.9.orig.tar.gz
Architecture independent archives:
http://security.debian.org/dists/stable/updates/main/binary-all/apache-doc_1.3.9-14.1_all.deb
Alpha architecture:
http://security.debian.org/dists/stable/updates/main/binary-alpha/apache-common_1.3.9-14.1_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/apache-dev_1.3.9-14.1_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/apache_1.3.9-14.1_alpha.deb
ARM architecture:
http://security.debian.org/dists/stable/updates/main/binary-arm/apache-common_1.3.9-14.1_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/apache-dev_1.3.9-14.1_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/apache_1.3.9-14.1_arm.deb
Intel IA-32 architecture:
http://security.debian.org/dists/stable/updates/main/binary-i386/apache-common_1.3.9-14.1_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/apache-dev_1.3.9-14.1_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/apache_1.3.9-14.1_i386.deb
Motorola 680x0 architecture:
http://security.debian.org/dists/stable/updates/main/binary-m68k/apache-common_1.3.9-14.1_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/apache-dev_1.3.9-14.1_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/apache_1.3.9-14.1_m68k.deb
PowerPC architecture:
http://security.debian.org/dists/stable/updates/main/binary-powerpc/apache-common_1.3.9-14.1_powerpc.deb
http://security.debian.org/dists/stable/updates/main/binary-powerpc/apache-dev_1.3.9-14.1_powerpc.deb
http://security.debian.org/dists/stable/up
补丁安装方法:
1. 手工安装补丁包:
首先,使用下面的命令来下载补丁软件:
# wget url (url是补丁下载链接地址)
然后,使用下面的命令来安装补丁:
# dpkg -i file.deb (file是相应的补丁名)
2. 使用apt-get自动安装补丁包:
首先,使用下面的命令更新内部数据库:
# apt-get update
然后,使用下面的命令安装更新软件包:
# apt-get upgrade
FreeBSD
-------
FreeBSD已经为此发布了一个安全公告(FreeBSD-SN-02:04)以及相应补丁:
FreeBSD-SN-02:04:security issues in ports
链接:ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SN-02:04 .asc
为了升级一个修复后的port包,可以采用下列两种方法中的任意一种:
1) 更新您的“Ports Collection”,然后重建、重新安装port.您可以使用下列几个工具来使升级工作更简单:
/usr/ports/devel/portcheckout
/usr/ports/misc/porteasy
/usr/ports/sysutils/portupgrade
2) 卸载旧的port软件包,从下列地址获取并安装一个新的包:
[i386]
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/All/
OpenBSD
-------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
ftp://ftp.openbsd.org/pub/OpenBSD/patches/3.1/common/005_httpd.patch
更多信息可以参考如下链接:
http://www.openbsd.org/errata.html#httpd
攻击脚本:
<a href=http://www.20cn.org/expolits/apache-scalp.c>apache-scalp.c</a> OPENBSD/X86 APACHE REMOTE EXPLOIT
<a href=http://www.20cn.org/expolits/apache-nosejob.c>apache-nosejob.c</a> OpenBSD/NetBSD
目前互联网上已经出现针对这个漏洞的蠕虫。这个蠕虫自动寻找脆弱的Apache web server实施攻击,驻留并攻击感染其它的Apache web server。代码下载:
apache-worm.c
eEye为此漏洞开发了一个脆弱性扫描器,下载:
<a href=http://www.20cn.org/download/RetinaApacheChunked.exe>RetinaApacheChunked.exe</a>