mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix SQL injection in get-host-dependencies (#13868)
Thanks to raf at TNP Consultants for reporting it
This commit is contained in:
@@ -31,6 +31,9 @@ if (! Auth::user()->hasGlobalAdmin()) {
|
||||
$order_by = '';
|
||||
if (isset($_POST['sort']) && is_array($_REQUEST['sort'])) {
|
||||
foreach ($_REQUEST['sort'] as $key => $value) {
|
||||
$key = preg_replace('/[^A-Za-z0-9_]/', '', $key); // only allow plain columns
|
||||
$value = strtolower($value) == 'desc' ? 'DESC' : 'ASC';
|
||||
|
||||
$order_by .= " $key $value";
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user