I got a security alert with "Dangerous File Inclusion" by using security software. It means that an attacker can take complete control of the dynamic include statement by supplying a malicious value for controller that causes the program to include a file from an external site. The report pointed out that the code in base file of componenet such as :
Code: Select all
require_once( JPATH_COMPONENT.DS.'controller.php' );
// Require specific controller if requested
if($controller = JRequest::getVar('controller')) {
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}
// Create the controller
$classname = 'DownloadController'.$controller;
$controller = new $classname( );
