mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix security vuls (#13554)
* Fix XSS vulnerabilities * fix XSS vulnerabilities in alerts.inc.php * fix XSS vulnerability in poller-groups.inc.php * small fix for the integration * another fix for the inegration * another fix for the inegration * change the sanitizer at sources instead of json_encode sinks * another change sanitizer at sources instead of json_encode sinks * another change sanitizer at sources instead of common_output and current_config sinks * fix path manipulation vulnerability
This commit is contained in:
@@ -44,5 +44,5 @@ if (! empty($group_name)) {
|
||||
if (! empty($ok)) {
|
||||
exit("$ok");
|
||||
} else {
|
||||
exit("ERROR: $error");
|
||||
exit('ERROR: ' . htmlspecialchars($error));
|
||||
}
|
||||
|
@@ -48,10 +48,10 @@ if (isset($_POST['device_id'])) {
|
||||
|
||||
if (! empty($update) || $update == '0') {
|
||||
$status = 'ok';
|
||||
$message = 'Devices of group ' . $_POST['device_group_id'] . ' will be rediscovered';
|
||||
$message = 'Devices of group ' . htmlspecialchars($_POST['device_group_id']) . ' will be rediscovered';
|
||||
} else {
|
||||
$status = 'error';
|
||||
$message = 'Error rediscovering devices of group ' . $_POST['device_group_id'];
|
||||
$message = 'Error rediscovering devices of group ' . htmlspecialchars($_POST['device_group_id']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@@ -38,7 +38,7 @@ if (! Auth::user()->hasGlobalAdmin()) {
|
||||
if (isset($_POST['device_id'])) {
|
||||
if (! is_numeric($_POST['device_id'])) {
|
||||
$status = 'error';
|
||||
$message = 'Invalid device id ' . $_POST['device_id'];
|
||||
$message = 'Invalid device id ' . htmlspecialchars($_POST['device_id']);
|
||||
} else {
|
||||
$device = Device::find($_POST['device_id']);
|
||||
|
||||
|
@@ -49,10 +49,10 @@ if (isset($_POST['sub_type']) && ! empty($_POST['sub_type'])) {
|
||||
}
|
||||
if (dbUpdate(['sensor_alert' => $state], 'sensors', '`sensor_id` = ? AND `device_id` = ?', [$_POST['sensor_id'], $_POST['device_id']]) >= 0) {
|
||||
$status = ($state == 0) ? 'info' : 'ok';
|
||||
$message = 'Alerts ' . $state_string . ' for sensor ' . $_POST['sensor_desc'];
|
||||
$message = 'Alerts ' . $state_string . ' for sensor ' . htmlspecialchars($_POST['sensor_desc']);
|
||||
} else {
|
||||
$status = 'error';
|
||||
$message = 'Couldn\'t ' . substr($state_string, 0, -1) . ' alerts for sensor ' . $_POST['sensor_desc'] . '. Enable debug and check librenms.log';
|
||||
$message = 'Couldn\'t ' . substr($state_string, 0, -1) . ' alerts for sensor ' . htmlspecialchars($_POST['sensor_desc']) . '. Enable debug and check librenms.log';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user