CSVForm是一款基于*NIX平台的Perl CGI脚本,用于把表格输入的数据格式化为逗号分割的数据,然后保存到文本文件中,一般是为了后续的数据库导入而用。 该脚本存在一个输入验证漏洞,允许远程攻击者以Web Server身份执行任意命令。 这是由于\"csvform.pl\"没有对用户的输入的\'\'file\'\'变量进行过滤,然后直接交给open()函数处理的结果。 有问题的代码如下: sub modify_CSV { if(open(CSV,$_[0])){ } else{ goto &produce_error( \"Can\'\'t open CSV file.\n\", \"Please, check that you have provided the cgi script with correct CSV file\", \" path in the HTML form.\n\" ); }
CSVForm是一款基于*NIX平台的Perl CGI脚本,用于把表格输入的数据格式化为逗号分割的数据,然后保存到文本文件中,一般是为了后续的数据库导入而用。 该脚本存在一个输入验证漏洞,允许远程攻击者以Web Server身份执行任意命令。 这是由于\"csvform.pl\"没有对用户的输入的\'\'file\'\'变量进行过滤,然后直接交给open()函数处理的结果。 有问题的代码如下: sub modify_CSV { if(open(CSV,$_[0])){ } else{ goto &produce_error( \"Can\'\'t open CSV file.\n\", \"Please, check that you have provided the cgi script with correct CSV file\", \" path in the HTML form.\n\" ); }