Fix some xss injection for sysLocation and some other fields (#15183)

Reported by [Zluudg](https://huntr.dev/users/zluudg/)
This commit is contained in:
Tony Murray
2023-08-02 09:51:31 -05:00
committed by GitHub
parent d810c7a648
commit 3252ea37af
6 changed files with 22 additions and 22 deletions

View File

@@ -153,10 +153,10 @@ class DeviceController extends TableController
'icon' => '<img src="' . asset($device->icon) . '" title="' . pathinfo($device->icon, PATHINFO_FILENAME) . '">',
'hostname' => $this->getHostname($device),
'metrics' => $this->getMetrics($device),
'hardware' => Rewrite::ciscoHardware($device),
'os' => $this->getOsText($device),
'hardware' => htmlspecialchars(Rewrite::ciscoHardware($device)),
'os' => htmlspecialchars($this->getOsText($device)),
'uptime' => (! $device->status && ! $device->last_polled) ? __('Never polled') : Time::formatInterval($device->status ? $device->uptime : $device->last_polled->diffInSeconds(), true),
'location' => $this->getLocation($device),
'location' => htmlspecialchars($this->getLocation($device)),
'actions' => view('device.actions', ['actions' => $this->getActions($device)])->__toString(),
'device_id' => $device->device_id,
];

View File

@@ -79,7 +79,7 @@ class LocationController extends TableController
{
return [
'id' => $location->id,
'location' => $location->location,
'location' => htmlspecialchars($location->location),
'lat' => $location->lat,
'lng' => $location->lng,
'down' => $location->devices()->isDown()->count(),