Skip to content

Commit 06ff76e

Browse files
committed
Fix security vulnerability in file manager allowing XSS attack
1 parent cd7ec73 commit 06ff76e

File tree

7 files changed

+25
-10
lines changed

7 files changed

+25
-10
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
## v0.7.14 (Derelict Dermodactylus)
7+
### Fixed
8+
* **[SECURITY]** Fixes an XSS vulnerability when performing certain actions in the file manager.
9+
10+
### Changed
11+
* Support for setting a node to listen on ports lower than 1024.
12+
* Regenerated database passwords now respect the same settings that were used when initially created.
13+
* Cleaned up 2FA QR code generation to use a more up-to-date library and API.
14+
* Console charts now properly start at 0 and scale based on server configuration. No more crazy spikes that
15+
are due to a change of one unit.
16+
617
## v0.7.13 (Derelict Dermodactylus)
718
### Fixed
819
* Fixes a bug with the location update API endpoint throwing an error due to an unexected response value.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Logo Image](https://cdn.pterodactyl.io/logos/Banner%20Logo%20Black@2x.png)](https://pterodactyl.io)
1+
[![Logo Image](https://cdn.pterodactyl.io/logos/new/pterodactyl_logo.png)](https://pterodactyl.io)
22

33
[![Build status](https://img.shields.io/travis/pterodactyl/panel/develop.svg?style=flat-square)](https://travis-ci.org/pterodactyl/panel)
44
[![StyleCI](https://styleci.io/repos/47508644/shield?branch=develop)](https://styleci.io/repos/47508644)

public/themes/pterodactyl/js/frontend/files/filemanager.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/themes/pterodactyl/js/frontend/files/filemanager.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/themes/pterodactyl/js/frontend/files/src/actions.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class ActionsClass {
2929
this.element = undefined;
3030
}
3131

32+
sanitizedString(value) {
33+
return $('<div>').text(value).html();
34+
}
35+
3236
folder(path) {
3337
let inputValue
3438
if (path) {
@@ -296,7 +300,7 @@ class ActionsClass {
296300
swal({
297301
type: 'warning',
298302
title: '',
299-
text: 'Are you sure you want to delete <code>' + delName + '</code>?',
303+
text: 'Are you sure you want to delete <code>' + this.sanitizedString(delName) + '</code>?',
300304
html: true,
301305
showCancelButton: true,
302306
showConfirmButton: true,
@@ -394,7 +398,7 @@ class ActionsClass {
394398
let formattedItems = "";
395399
let i = 0;
396400
$.each(selectedItems, function(key, value) {
397-
formattedItems += ("<code>" + value + "</code>, ");
401+
formattedItems += ("<code>" + this.sanitizedString(value) + "</code>, ");
398402
i++;
399403
return i < 5;
400404
});
@@ -407,7 +411,7 @@ class ActionsClass {
407411
swal({
408412
type: 'warning',
409413
title: '',
410-
text: 'Are you sure you want to delete the following files: ' + formattedItems + '?',
414+
text: 'Are you sure you want to delete the following files: ' + this.sanitizedString(formattedItems) + '?',
411415
html: true,
412416
showCancelButton: true,
413417
showConfirmButton: true,
@@ -536,7 +540,7 @@ class ActionsClass {
536540
type: 'error',
537541
title: 'Whoops!',
538542
html: true,
539-
text: error
543+
text: this.sanitizedString(error)
540544
});
541545
});
542546
}

public/themes/pterodactyl/js/frontend/files/src/contextmenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ContextMenuClass {
6262

6363
if (Pterodactyl.permissions.createFiles) {
6464
buildMenu += '<li class="divider"></li> \
65-
<li data-action="file"><a href="/server/'+ Pterodactyl.server.uuidShort +'/files/add/?dir=' + newFilePath + '" class="text-muted"><i class="fa fa-fw fa-plus"></i> New File</a></li> \
65+
<li data-action="file"><a href="/server/'+ Pterodactyl.server.uuidShort +'/files/add/?dir=' + $('<div>').text(newFilePath).html() + '" class="text-muted"><i class="fa fa-fw fa-plus"></i> New File</a></li> \
6666
<li data-action="folder"><a tabindex="-1" href="#"><i class="fa fa-fw fa-folder"></i> New Folder</a></li>';
6767
}
6868

resources/themes/pterodactyl/server/files/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
{!! Theme::js('vendor/lodash/lodash.js') !!}
4545
{!! Theme::js('vendor/siofu/client.min.js') !!}
4646
@if(App::environment('production'))
47-
{!! Theme::js('js/frontend/files/filemanager.min.js?updated-cancel-buttons') !!}
47+
{!! Theme::js('js/frontend/files/filemanager.min.js?hash=cd7ec731dc633e23ec36144929a237d18c07d2f0') !!}
4848
@else
4949
{!! Theme::js('js/frontend/files/src/index.js') !!}
5050
{!! Theme::js('js/frontend/files/src/contextmenu.js') !!}

0 commit comments

Comments
 (0)