Fix Parameter based Indirect Object Referencing leading to private file exposure
This commit is contained in:
committed by
Frédéric Guillot
parent
cda45ddb30
commit
437b141fa2
@@ -89,10 +89,10 @@ abstract class BaseController extends Base
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @return array
|
* @return array
|
||||||
* @throws PageNotFoundException
|
* @throws PageNotFoundException
|
||||||
* @throws AccessForbiddenException
|
|
||||||
*/
|
*/
|
||||||
protected function getFile()
|
protected function getFile()
|
||||||
{
|
{
|
||||||
|
$project_id = $this->request->getIntegerParam('project_id');
|
||||||
$task_id = $this->request->getIntegerParam('task_id');
|
$task_id = $this->request->getIntegerParam('task_id');
|
||||||
$file_id = $this->request->getIntegerParam('file_id');
|
$file_id = $this->request->getIntegerParam('file_id');
|
||||||
$model = 'projectFileModel';
|
$model = 'projectFileModel';
|
||||||
@@ -108,7 +108,11 @@ abstract class BaseController extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($file['task_id']) && $file['task_id'] != $task_id) {
|
if (isset($file['task_id']) && $file['task_id'] != $task_id) {
|
||||||
throw new AccessForbiddenException();
|
throw new PageNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($file['project_id']) && $file['project_id'] != $project_id) {
|
||||||
|
throw new PageNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$file['model'] = $model;
|
$file['model'] = $model;
|
||||||
|
|||||||
Reference in New Issue
Block a user