Steve Grimm Un-CGI 目录遍历漏洞

2008-04-09 04:30:59来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Steve Grimm Un-CGI 目录遍历漏洞

发布日期:2001-07-17
更新日期:2001-07-25

受影响系统:

Steve Grimm Un-CGI 1.9
Steve Grimm Un-CGI 1.8
Steve Grimm Un-CGI 1.7
Steve Grimm Un-CGI 1.6.2
Steve Grimm Un-CGI 1.6.1
Steve Grimm Un-CGI 1.6
Steve Grimm Un-CGI 1.5
Steve Grimm Un-CGI 1.4
Steve Grimm Un-CGI 1.3
Steve Grimm Un-CGI 1.2
Steve Grimm Un-CGI 1.1
Steve Grimm Un-CGI 1.0
不受影响系统:

Steve Grimm Un-CGI 1.10
描述:

BUGTRAQ ID: 3056
CVE(CAN) ID: CAN-2001-1242

Un-CGI是种免费CGI封装应用程序。其主要用于解析URL输入并提交给CGI应用程序,
可以库方式使用,也可以单独执行。但是它没有过滤用户输入中的"../"序列,远程
用户可以访问WEB SERVER所能访问的任意文件。该漏洞还可用于远程执行其他脚本。

<* 来源:Khamba Staring (purrcat@edoropolis.org) *>


建议:

临时解决方法:

下面这个补丁是Khamba Staring (purrcat@edoropolis.org)提供的
临时解决方案

--------------------------------------------------------------------------
--- uncgi.c.old Thu Jul 12 12:42:09 2001
uncgi.c Thu Jul 12 13:24:35 2001
@@ -60,6 60,14 @@

char *id = "@(#)uncgi.c 1.33 11/24/97";


void four_oh_three()
{
printf("Content-Type: text/htm\n\n");
printf("You have no permission!\n");
exit(1);
}

/*
* Convert two hex digits to a value.
*/
@@ -373,6 381,18 @@
char *shell, *script;
{
char *argvec[4], **ppArg = argvec, *pz;
struct stat f_stat;

if(stat(script, &f_stat) == -1)
html_perror("stat (something like this; dunno what html_perror does
exactly)");

/*
** this should probably be expanded a bit; maybe check for S_IXUSR, S_IXGRP
** and S_IXOTH or the likes. Maybe add extra checks for suid or let the
** shell figure that out?
*/
if(!(f_stat.st_mode & S_IXUSR))
html_perror("not executable");

/*
* "shell" really points to the character following the "#!",
@@ -542,6 562,21 @@
#endif
}

int check_path(char *evilpath)
{
#define RP_PATHLEN 1024
char resolved_path[RP_PATHLEN];

if(!realpath(evilpath, resolved_path))
return(0); /* evil path cannot be read; this can't be good! */

if(strncmp(SCRIPT_BIN, resolved_path, strlen(SCRIPT_BIN) - 1) == 0)
return(1); /* yay! */
else
return(0); /* boo! */
}


#ifndef LIBRARY /* { */
main(argc, argv)
int argc;
@@ -600,6 635,11 @@
strcpy(program, SCRIPT_BIN);
strncat(program sizeof(SCRIPT_BIN) - 1, pathinfo, proglen);

#ifndef VOID_SECURITY
if(!check_path(program))
four_oh_three();
#endif

#ifdef DEBUG
printf("Program path is '%s'\n", program);
fflush(stdout);
@@ -700,6 740,9 @@
*/
argvec[0] = program;
argvec[1] = NULL;
/*
** shouldn't we check for suid stuff here?!
*/
execv(program, argvec);

#ifdef __MSDOS__ /* { */

厂商补丁:

Steve Grimm Un-CGI 1.10已经解决了这个问题,我们建议使用此软件的用户升级到最新版本:http://www.midwinter.com/~koreth/uncgi.html


标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:IRIX 'netprint' 打开任意动态链接库漏洞

下一篇:SSH 3.0 远程登录漏洞