mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix another addcslashes incorrect escape in eventlog (#15313)
and many more reported by: https://huntr.dev/users/hainguyen0207
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
* @author LibreNMS Contributors
|
||||
*/
|
||||
|
||||
$vars['eventtype'] = 'test\"-alert(document.cookie)//';
|
||||
|
||||
$common_output[] = '
|
||||
<div class="table-responsive">
|
||||
<table id="eventlog" class="table table-hover table-condensed table-striped">
|
||||
@@ -36,7 +38,7 @@ var eventlog_grid = $("#eventlog").bootgrid({
|
||||
{
|
||||
return {
|
||||
device: ' . (empty($vars['device']) ? 'null' : (int) $vars['device']) . ',
|
||||
eventtype: "' . addcslashes($vars['eventtype'] ?? '', '"') . '",
|
||||
eventtype: "' . htmlspecialchars($vars['eventtype'] ?? '') . '",
|
||||
};
|
||||
},
|
||||
url: "' . url('/ajax/table/eventlog') . '"
|
||||
|
@@ -37,11 +37,11 @@ var syslog_grid = $("#syslog").bootgrid({
|
||||
post: function ()
|
||||
{
|
||||
return {
|
||||
device: "' . addcslashes($vars['device'] ?? '', '"') . '",
|
||||
program: "' . addcslashes($vars['program'] ?? '', '"') . '",
|
||||
priority: "' . addcslashes($vars['priority'] ?? '', '"') . '",
|
||||
to: "' . addcslashes($vars['to'] ?? '', '"') . '",
|
||||
from: "' . addcslashes($vars['from'] ?? '', '"') . '",
|
||||
device: "' . htmlspecialchars($vars['device'] ?? '') . '",
|
||||
program: "' . htmlspecialchars($vars['program'] ?? '') . '",
|
||||
priority: "' . htmlspecialchars($vars['priority'] ?? '') . '",
|
||||
to: "' . htmlspecialchars($vars['to'] ?? '') . '",
|
||||
from: "' . htmlspecialchars($vars['from'] ?? '') . '",
|
||||
};
|
||||
},
|
||||
url: "' . url('/ajax/table/syslog') . '"
|
||||
|
@@ -106,6 +106,6 @@ $pagetitle[] = 'Eventlog';
|
||||
}
|
||||
}
|
||||
}
|
||||
})<?php echo Request::get('eventtype') ? ".val('" . addcslashes(Request::get('eventtype'), "'") . "').trigger('change');" : ''; ?>;
|
||||
})<?php echo Request::get('eventtype') ? ".val('" . htmlspecialchars(Request::get('eventtype')) . "').trigger('change');" : ''; ?>;
|
||||
|
||||
</script>
|
||||
|
@@ -171,7 +171,7 @@ $pagetitle[] = 'Syslog';
|
||||
}
|
||||
}
|
||||
}
|
||||
})<?php echo isset($vars['program']) ? ".val('" . addcslashes($vars['program'], "'") . "').trigger('change');" : ''; ?>;
|
||||
})<?php echo isset($vars['program']) ? ".val('" . htmlspecialchars($vars['program']) . "').trigger('change');" : ''; ?>;
|
||||
|
||||
$("#priority").select2({
|
||||
theme: "bootstrap",
|
||||
@@ -191,6 +191,6 @@ $pagetitle[] = 'Syslog';
|
||||
}
|
||||
}
|
||||
}
|
||||
})<?php echo isset($vars['priority']) ? ".val('" . addcslashes($vars['priority'], "'") . "').trigger('change');" : ''; ?>;
|
||||
})<?php echo isset($vars['priority']) ? ".val('" . htmlspecialchars($vars['priority']) . "').trigger('change');" : ''; ?>;
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user