Skip to content

Commit

Permalink
Merge branch 'release/v1.11.7' of https://github.com/pterodactyl/panel
Browse files Browse the repository at this point in the history
…into release/v1.11.5
  • Loading branch information
Angelillo15 committed May 11, 2024
2 parents 235e100 + 62b8a53 commit c332151
Show file tree
Hide file tree
Showing 29 changed files with 197 additions and 236 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ 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.

## v1.11.7

### Added

* Java 21 to Minecraft eggs

### Changed

* Updated Minecraft EULA link

### Fixed

* Fixed backups not ever being marked as completed (#5088)
* Fixed `.7z` files not being detected as a compressed file (#5016)

## v1.11.6

### Changed

* Better node ownership checks for internal backup endpoints
* Improved validation rules on `docker_image` fields to prevent invalid inputs

### Fixed

* Multiple XSS vulnerabilities in the admin area ([GHSA-384w-wffr-x63q](https://github.com/pterodactyl/panel/security/advisories/GHSA-384w-wffr-x63q))

## v1.11.5
### Fixed
* Rust egg using the wrong Docker image, breaking Rust modding frameworks.
Expand Down
1 change: 0 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The following versions of Pterodactyl are receiving active support and maintenan

| Panel | Daemon | Supported |
|--------|--------------|--------------------|
| 1.10.x | [email protected] | :white_check_mark: |
| 1.11.x | [email protected] | :white_check_mark: |
| 0.7.x | [email protected] | :x: |

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/Nests/EggVariableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function update(EggVariableFormRequest $request, Egg $egg, EggVariable $v
{
$this->updateService->handle($variable, $request->normalize());
$this->alert->success(trans('admin/nests.variables.notices.variable_updated', [
'variable' => $variable->name,
'variable' => htmlspecialchars($variable->name),
]))->flash();

return redirect()->route('admin.nests.egg.variables', $egg->id);
Expand All @@ -82,7 +82,7 @@ public function destroy(int $egg, EggVariable $variable): RedirectResponse
{
$this->variableRepository->delete($variable->id);
$this->alert->success(trans('admin/nests.variables.notices.variable_deleted', [
'variable' => $variable->name,
'variable' => htmlspecialchars($variable->name),
]))->flash();

return redirect()->route('admin.nests.egg.variables', $egg);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Nests/NestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function create(): View
public function store(StoreNestFormRequest $request): RedirectResponse
{
$nest = $this->nestCreationService->handle($request->normalize());
$this->alert->success(trans('admin/nests.notices.created', ['name' => $nest->name]))->flash();
$this->alert->success(trans('admin/nests.notices.created', ['name' => htmlspecialchars($nest->name)]))->flash();

return redirect()->route('admin.nests.view', $nest->id);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/NodesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function allocationRemoveBlock(Request $request, int $node): RedirectResp
['ip', '=', $request->input('ip')],
]);

$this->alert->success(trans('admin/node.notices.unallocated_deleted', ['ip' => $request->input('ip')]))
$this->alert->success(trans('admin/node.notices.unallocated_deleted', ['ip' => htmlspecialchars($request->input('ip'))]))
->flash();

return redirect()->route('admin.nodes.view.allocation', $node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,32 @@ public function __construct(private BackupManager $backupManager)
*/
public function __invoke(Request $request, string $backup): JsonResponse
{
// Get the node associated with the request.
/** @var \Pterodactyl\Models\Node $node */
$node = $request->attributes->get('node');

// Get the size query parameter.
$size = (int) $request->query('size');
if (empty($size)) {
throw new BadRequestHttpException('A non-empty "size" query parameter must be provided.');
}

/** @var \Pterodactyl\Models\Backup $backup */
$backup = Backup::query()->where('uuid', $backup)->firstOrFail();
/** @var \Pterodactyl\Models\Backup $model */
$model = Backup::query()
->where('uuid', $backup)
->firstOrFail();

// Check that the backup is "owned" by the node making the request. This avoids other nodes
// from messing with backups that they don't own.
/** @var \Pterodactyl\Models\Server $server */
$server = $model->server;
if ($server->node_id !== $node->id) {
throw new HttpForbiddenException('You do not have permission to access that backup.');
}

// Prevent backups that have already been completed from trying to
// be uploaded again.
if (!is_null($backup->completed_at)) {
if (!is_null($model->completed_at)) {
throw new ConflictHttpException('This backup is already in a completed state.');
}

Expand All @@ -54,7 +68,7 @@ public function __invoke(Request $request, string $backup): JsonResponse
}

// The path where backup will be uploaded to
$path = sprintf('%s/%s.tar.gz', $backup->server->uuid, $backup->uuid);
$path = sprintf('%s/%s.tar.gz', $model->server->uuid, $model->uuid);

// Get the S3 client
$client = $adapter->getClient();
Expand Down Expand Up @@ -92,7 +106,7 @@ public function __invoke(Request $request, string $backup): JsonResponse
}

// Set the upload_id on the backup in the database.
$backup->update(['upload_id' => $params['UploadId']]);
$model->update(['upload_id' => $params['UploadId']]);

return new JsonResponse([
'parts' => $parts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,22 @@ public function __construct(private BackupManager $backupManager)
*/
public function index(ReportBackupCompleteRequest $request, string $backup): JsonResponse
{
// Get the node associated with the request.
/** @var \Pterodactyl\Models\Node $node */
$node = $request->attributes->get('node');

/** @var \Pterodactyl\Models\Backup $model */
$model = Backup::query()->where('uuid', $backup)->firstOrFail();
$model = Backup::query()
->where('uuid', $backup)
->firstOrFail();

// Check that the backup is "owned" by the node making the request. This avoids other nodes
// from messing with backups that they don't own.
/** @var \Pterodactyl\Models\Server $server */
$server = $model->server;
if ($server->node_id !== $node->id) {
throw new HttpForbiddenException('You do not have permission to access that backup.');
}

if ($model->is_successful) {
throw new BadRequestHttpException('Cannot update the status of a backup that is already marked as completed.');
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Admin/Egg/EggFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function rules(): array
$rules = [
'name' => 'required|string|max:191',
'description' => 'nullable|string',
'docker_images' => 'required|string',
'docker_images' => ['required', 'string', 'regex:/^[\w#\.\/\- ]*\|*[\w\.\/\-:@ ]*$/im'],
'force_outgoing_ip' => 'sometimes|boolean',
'file_denylist' => 'array',
'startup' => 'required|string',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Admin/Nest/StoreNestFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StoreNestFormRequest extends AdminFormRequest
public function rules(): array
{
return [
'name' => 'required|string|min:1|max:191',
'name' => 'required|string|min:1|max:191|regex:/^[\w\- ]+$/',
'description' => 'string|nullable',
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function rules(): array
Assert::isInstanceOf($server, Server::class);

return [
'docker_image' => ['required', 'string', Rule::in(array_values($server->egg->docker_images))],
'docker_image' => ['required', 'string', 'max:191', 'regex:/^[\w#\.\/\- ]*\|*[\w\.\/\-:@ ]*$/', Rule::in(array_values($server->egg->docker_images))],
];
}
}
2 changes: 1 addition & 1 deletion app/Models/Egg.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Egg extends Model
'file_denylist' => 'array|nullable',
'file_denylist.*' => 'string',
'docker_images' => 'required|array|min:1',
'docker_images.*' => 'required|string',
'docker_images.*' => ['required', 'string', 'max:191', 'regex:/^[\w#\.\/\- ]*\|*[\w\.\/\-:@ ]*$/'],
'startup' => 'required|nullable|string',
'config_from' => 'sometimes|bail|nullable|numeric|exists:eggs,id',
'config_stop' => 'required_without:config_from|nullable|string|max:191',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Server extends Model
'egg_id' => 'required|exists:eggs,id',
'startup' => 'required|string',
'skip_scripts' => 'sometimes|boolean',
'image' => 'required|string|max:191',
'image' => ['required', 'string', 'max:191', 'regex:/^[\w\.\/\-:@ ]*$/'],
'database_limit' => 'present|nullable|integer|min:0',
'allocation_limit' => 'sometimes|nullable|integer|min:0',
'backup_limit' => 'present|nullable|integer|min:0',
Expand Down
4 changes: 2 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| change this value if you are not maintaining your own internal versions.
*/

'version' => '1.11.5',
'version' => '1.11.7',

/*
|--------------------------------------------------------------------------
Expand All @@ -21,7 +21,7 @@
| change this value if you are not maintaining your own internal versions.
*/

'fork-version' => '1.2.1',
'fork-version' => '1.3.1',

/*
|--------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions database/Seeders/eggs/minecraft/egg-bungeecord.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-06-17T08:10:44+03:00",
"exported_at": "2024-05-07T12:55:57+00:00",
"name": "Bungeecord",
"author": "[email protected]",
"description": "For a long time, Minecraft server owners have had a dream that encompasses a free, easy, and reliable way to connect multiple Minecraft servers together. BungeeCord is the answer to said dream. Whether you are a small server wishing to string multiple game-modes together, or the owner of the ShotBow Network, BungeeCord is the ideal solution for you. With the help of BungeeCord, you will be able to unlock your community's full potential.",
Expand All @@ -14,6 +14,7 @@
"pid_limit"
],
"docker_images": {
"Java 21": "ghcr.io\/pterodactyl\/yolks:java_21",
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
Expand Down Expand Up @@ -56,4 +57,4 @@
"field_type": "text"
}
]
}
}
5 changes: 3 additions & 2 deletions database/Seeders/eggs/minecraft/egg-forge-minecraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-11-06T06:33:01-05:00",
"exported_at": "2024-05-07T12:55:56+00:00",
"name": "Forge Minecraft",
"author": "[email protected]",
"description": "Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.",
Expand All @@ -14,6 +14,7 @@
"pid_limit"
],
"docker_images": {
"Java 21": "ghcr.io\/pterodactyl\/yolks:java_21",
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
Expand Down Expand Up @@ -76,4 +77,4 @@
"field_type": "text"
}
]
}
}
5 changes: 3 additions & 2 deletions database/Seeders/eggs/minecraft/egg-paper.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-06-17T08:11:30+03:00",
"exported_at": "2024-05-07T12:55:55+00:00",
"name": "Paper",
"author": "[email protected]",
"description": "High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.",
Expand All @@ -14,6 +14,7 @@
"pid_limit"
],
"docker_images": {
"Java 21": "ghcr.io\/pterodactyl\/yolks:java_21",
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
Expand Down Expand Up @@ -76,4 +77,4 @@
"field_type": "text"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-06-17T08:11:42+03:00",
"exported_at": "2024-05-07T12:55:54+00:00",
"name": "Sponge (SpongeVanilla)",
"author": "[email protected]",
"description": "SpongeVanilla is the SpongeAPI implementation for Vanilla Minecraft.",
Expand All @@ -14,6 +14,7 @@
"pid_limit"
],
"docker_images": {
"Java 21": "ghcr.io\/pterodactyl\/yolks:java_21",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8"
Expand Down Expand Up @@ -55,4 +56,4 @@
"field_type": "text"
}
]
}
}
5 changes: 3 additions & 2 deletions database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-06-17T08:11:58+03:00",
"exported_at": "2024-05-07T12:55:58+00:00",
"name": "Vanilla Minecraft",
"author": "[email protected]",
"description": "Minecraft is a game about placing blocks and going on adventures. Explore randomly generated worlds and build amazing things from the simplest of homes to the grandest of castles. Play in Creative Mode with unlimited resources or mine deep in Survival Mode, crafting weapons and armor to fend off dangerous mobs. Do all this alone or with friends.",
Expand All @@ -14,6 +14,7 @@
"pid_limit"
],
"docker_images": {
"Java 21": "ghcr.io\/pterodactyl\/yolks:java_21",
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
Expand Down Expand Up @@ -56,4 +57,4 @@
"field_type": "text"
}
]
}
}
2 changes: 1 addition & 1 deletion database/Seeders/eggs/rust/egg-rust.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"default_value": "vanilla",
"user_viewable": true,
"user_editable": true,
"rules": "required|in:carbon,oxide,vanilla",
"rules": "required|in:vanilla,oxide,carbon",
"field_type": "text"
},
{
Expand Down
Loading

0 comments on commit c332151

Please sign in to comment.