mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Resolved some security issues
This commit is contained in:
@@ -36,7 +36,7 @@ if (!$_SESSION['authenticated']) {
|
||||
$output = '';
|
||||
if ($_GET['query'] && $_GET['cmd']) {
|
||||
$host = $_GET['query'];
|
||||
if (Net_IPv6::checkIPv6($host) || Net_IPv4::validateip($host) || preg_match('/^[a-zA-Z0-9.-]*$/', $host)) {
|
||||
if (Net_IPv6::checkIPv6($host) || Net_IPv4::validateip($host) || filter_var('http://'.$host, FILTER_VALIDATE_URL)) {
|
||||
switch ($_GET['cmd']) {
|
||||
case 'whois':
|
||||
$cmd = $config['whois']." $host | grep -v \%";
|
||||
@@ -66,5 +66,5 @@ if ($_GET['query'] && $_GET['cmd']) {
|
||||
}//end if
|
||||
}//end if
|
||||
|
||||
$output = trim($output);
|
||||
$output = htmlentities(trim($output), ENT_QUOTES);
|
||||
echo "<pre>$output</pre>";
|
||||
|
@@ -44,7 +44,7 @@ if (is_array($config['branding'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['device'])) {
|
||||
if (is_numeric($_GET['device']) && isset($_GET['device'])) {
|
||||
$where = 'WHERE device_id = '.mres($_GET['device']);
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user