Fix XSS in api access (#14551)

api access page didn't escape username allowing for injection.
This commit is contained in:
Tony Murray
2022-11-01 05:20:08 -05:00
committed by GitHub
parent e864ed7795
commit 07cc9f4cdc

View File

@@ -59,7 +59,7 @@ if (Auth::user()->hasGlobalAdmin()) {
<select class="form-control" id="user_id" name="user_id">
<?php
foreach ($userlist = User::all() as $user) {
echo '<option value="' . $user->user_id . '">' . $user->username . ' (' . $user->auth_type . ')</option>';
echo '<option value="' . $user->user_id . '">' . htmlentities($user->username) . ' (' . htmlentities($user->auth_type) . ')</option>';
} ?>
</select>
</div>