diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d7d93d1..8958e82be 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 97f05487b..b94e804d7 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 '