diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d7d93d1a..8958e82be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file is a running track of new features and fixes to each version of the pa This project follows [Semantic Versioning](http://semver.org) guidelines. +## v0.7.19 (Derelict Dermodactylus) +### Fixed +* **[Security]** Fixes XSS in the admin area's server owner selection. + ## v0.7.18 (Derelict Dermodactylus) ### Fixed * **[Security]** Re-addressed missed endpoint that would not properly limit a user account to 5 API keys. diff --git a/public/themes/pterodactyl/js/admin/new-server.js b/public/themes/pterodactyl/js/admin/new-server.js index 97f05487b6..b94e804d7d 100644 --- a/public/themes/pterodactyl/js/admin/new-server.js +++ b/public/themes/pterodactyl/js/admin/new-server.js @@ -37,6 +37,12 @@ $(document).ready(function() { placeholder: 'Select Additional Allocations', }); + function escapeHtml(str) { + var div = document.createElement('div'); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; + } + $('#pUserId').select2({ ajax: { url: Router.route('admin.users.json'), @@ -56,23 +62,23 @@ $(document).ready(function() { escapeMarkup: function (markup) { return markup; }, minimumInputLength: 2, templateResult: function (data) { - if (data.loading) return data.text; + if (data.loading) return escapeHtml(data.text); return '
\ - User Image \ + User Image \ \ - ' + data.name_first + ' ' + data.name_last +' \ + ' + escapeHtml(data.name_first) + ' ' + escapeHtml(data.name_last) +' \ \ - ' + data.email + ' - ' + data.username + ' \ + ' + escapeHtml(data.email) + ' - ' + escapeHtml(data.username) + ' \
'; }, templateSelection: function (data) { return '
\ \ - User Image \ + User Image \ \ \ - ' + data.name_first + ' ' + data.name_last + ' (' + data.email + ') \ + ' + escapeHtml(data.name_first) + ' ' + escapeHtml(data.name_last) + ' (' + escapeHtml(data.email) + ') \ \
'; } diff --git a/resources/themes/pterodactyl/admin/servers/view/details.blade.php b/resources/themes/pterodactyl/admin/servers/view/details.blade.php index a84a9144cb..5eb8d20553 100644 --- a/resources/themes/pterodactyl/admin/servers/view/details.blade.php +++ b/resources/themes/pterodactyl/admin/servers/view/details.blade.php @@ -83,6 +83,12 @@ @section('footer-scripts') @parent