Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Fix a security problem. Thanks to Julien Szlamowicz && Damien Picard …
Browse files Browse the repository at this point in the history
…from company synacktiv
  • Loading branch information
David Durieux committed Mar 28, 2019
1 parent 9107173 commit 0f777f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions front/send_inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@
//Session::checkRight('config', "w");

$itemtype = $_GET['itemtype'];
$function = $_GET['function'];
$items_id = $_GET['items_id'];

header('Cache-control: private, must-revalidate'); /// IE BUG + SSL
header('Content-disposition: attachment; filename='.$_GET['filename']);
header('Content-type: text/plain');


call_user_func(['PluginFusioninventoryToolbox', $function], $items_id, $itemtype);
call_user_func(['PluginFusioninventoryToolbox', 'sendXML'], $items_id, $itemtype);

3 changes: 2 additions & 1 deletion inc/toolbox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ static function sendSerializedInventory($items_id, $itemtype) {
* @param string $itemtype
*/
static function sendXML($items_id, $itemtype) {
if (call_user_func([$itemtype, 'canView'])) {
if (preg_match("/^([a-zA-Z]+)\/(\d+)\/(\d+)\.xml$/", $items_id)
&& call_user_func([$itemtype, 'canView'])) {
$xml = file_get_contents(GLPI_PLUGIN_DOC_DIR."/fusioninventory/xml/".$items_id);
echo $xml;
} else {
Expand Down

0 comments on commit 0f777f8

Please sign in to comment.