mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Prevent unauthorized access to device graphs
Users could access info for the wrong device by piggyback on port permissions
This commit is contained in:
@@ -72,6 +72,12 @@ class DeviceController extends Controller
|
||||
if ($current_tab == 'port') {
|
||||
$vars = Url::parseLegacyPath($request->path());
|
||||
$port = Port::findOrFail($vars->get('port'));
|
||||
|
||||
// This prevents users from traversal device id's by piggybacking on the auth for the specified port
|
||||
if ($port->device_id !== $device_id) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$this->authorize('view', $port);
|
||||
} else {
|
||||
$this->authorize('view', $device);
|
||||
|
Reference in New Issue
Block a user