安全研究
安全漏洞
Wu-ftpd SockPrintf()远程栈缓冲区溢出漏洞
发布日期:2003-09-22
更新日期:2003-09-28
受影响系统:
Washington University wu-ftpd 2.6.2描述:
Washington University wu-ftpd 2.6.0
Washington University wu-ftpd 2.5.0
Washington University wu-ftpd 2.6.1
- Caldera OpenLinux 2.3
- Caldera OpenLinux Server 3.1
- Cobalt Qube 1.0
- Conectiva Linux 8.0
- Conectiva Linux 7.0
- Conectiva Linux 6.0
- FreeBSD 5.0
- FreeBSD 4.4
- FreeBSD 4.3
- Mandrake Linux Corporate Server 1.0.1
- Mandrake Linux 8.1
- Mandrake Linux 8.0
- Mandrake Linux 7.2
- Mandrake Linux 7.1
- Mandrake Linux 7.0
- Mandrake Linux 6.1
- Mandrake Linux 6.0
- RedHat Linux 7.2
- RedHat Linux 7.1
- RedHat Linux 7.0
- Slackware Linux 8.0
- Slackware Linux 7.1
- Slackware Linux 7.0
- SuSE Linux 7.3
- SuSE Linux 7.2
- SuSE Linux 7.1
- SuSE Linux 7.0
- Turbo Linux 6.0.5
- Turbo Linux 6.0.4
- Turbo Linux 6.0.3
- Turbo Linux 6.0.2
- Turbo Linux 6.0.1
- Turbo Linux 6.0
- Wirex Immunix OS Linux 7.0-beta
- Wirex Immunix OS Linux 7.0
BUGTRAQ ID: 8668
CVE(CAN) ID: CVE-2003-1327
Wu-ftpd是一个基于BSD ftpd的FTP服务器程序,由华盛顿大学维护。
Wu-ftpd包含的SockPrintf()函数在处理输入时缺少正确的边界缓冲区检查,远程攻击者可以通过这个漏洞对服务器进行缓冲区溢出攻击,可能以root用户权限在系统上执行任意指令。
问题存在于SockPrintf()函数使用vsprintf()时:
"in file src/ftpd.c"
int SockPrintf(FILE *sockfp, char *format,...)
{
va_list ap;
char buf[32768];
va_start(ap, format);
vsprintf(buf, format, ap);
va_end(ap);
return SockWrite(buf, 1, strlen(buf), sockfp);
}
buf是字符数组(32768),vsprintf使用参数*format,然后在store()函数中:
"in file src/ftpd.c"
void store(char *name, char *mode, int unique)
{
...
...
#ifdef MAIL_ADMIN
...
...
SockPrintf(sck, "From: wu-ftpd <%s>\r\n", mailfrom);
SockPrintf(sck, "Subject: New file uploaded: %s\r\n\r\n", name);
...
SockPrintf(sck, "%s uploaded %s from %s.\r\nFile size is %d.\r\n
Please move the file where it belongs.\r\n",guestpw, pathname, remotehost, byte_count);
...
#endif /* MAIL_ADMIN */
...
...
}
这个函数攻击者可以控制参数名,因此可以远程调用:
SockPrintf(sck, "Subject: New file uploaded: %s\r\n\r\n", name);
并触发溢出,攻击者可以通过精心构建超长的文件路径,可能以root用户权限在系统上执行任意指令。
不过此漏洞不存在默认安装Wu-Ftpd服务程序中,服务器必须以'MAIL_ADMIN'选项配置才存在此漏洞。
<*来源:Adam Zabrocki (pi3ki31ny@wp.pl)
链接:http://marc.theaimsgroup.com/?l=bugtraq&m=106424869909343&w=2
*>
建议:
厂商补丁:
Slackware
---------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
Updated package for Slackware 9.0:
ftp://ftp.slackware.com/pub/slackware/slackware-9.0/pasture/dontuse/wu-ftpd/wu-ftpd-2.6.2-i386-3.tgz
Updated package for Slackware -current:
ftp://ftp.slackware.com/pub/slackware/slackware-current/pasture/dontuse/wu-ftpd/wu-ftpd-2.6.2-i486-3.tgz
浏览次数:5072
严重程度:0(网友投票)
绿盟科技给您安全的保障