mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
plug shell injection hole in map.php (thanks to Scrye)
git-svn-id: http://www.observium.org/svn/observer/trunk@1210 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -116,6 +116,15 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
|
|||||||
|
|
||||||
if ($_GET['debug'] == 1) { echo("<pre>$map</pre>");exit(); }
|
if ($_GET['debug'] == 1) { echo("<pre>$map</pre>");exit(); }
|
||||||
|
|
||||||
|
switch ($_GET['format'])
|
||||||
|
{
|
||||||
|
case 'svg':
|
||||||
|
case 'png':
|
||||||
|
break;
|
||||||
|
case default:
|
||||||
|
$_GET['format'] = 'png';
|
||||||
|
}
|
||||||
|
|
||||||
$img = shell_exec("echo \"".addslashes($map)."\" | dot -T".$_GET['format']."");
|
$img = shell_exec("echo \"".addslashes($map)."\" | dot -T".$_GET['format']."");
|
||||||
if($_GET['format'] == "png") {
|
if($_GET['format'] == "png") {
|
||||||
header("Content-type: image/".$_GET['format']);
|
header("Content-type: image/".$_GET['format']);
|
||||||
|
|||||||
Reference in New Issue
Block a user