<<< Date Index >>>     <<< Thread Index >>>

Re: Cross site scripting & fullpath disclosure



The solution to this is to insert the following code in sp_helper_functions.php 
at line 10:

if (!file_exists(stripslashes($input_dir)))
        return array();

This should come immediatly before the original line 10 which is:               

$dh  = opendir(stripslashes($input_dir));       

This is alters function getDirList which should now read as follows:

//THIS FUNCTION WILL RETURN A SORTED ARRAY OF ALL FILES AND FOLDERS IN THE 
CURRENT DIRECTORY
function getDirList($input_dir="") 
{
        global $dir;
        if($input_dir == '')
                $input_dir = $dir;
        //echo "--" . stripslashes($input_dir) , "--";
        
        // the following is a fix for 
http://nvd.nist.gov/nvd.cfm?cvename=CVE-2006-6273
        // by James Brown 10:53 AM 12/27/2006
        if (!file_exists(stripslashes($input_dir)))
                return array();
                
        $dh  = opendir(stripslashes($input_dir));       
        while (false !== ($filename = readdir($dh))) 
        {
                $files[] = $filename;
        }
        @sort($files);
        return $files;
}