CVE-2024-34067 (PHP, published 2024-05-03T18:15Z)
Description: value: Pterodactyl is a free, open-source game server management panel built with PHP, React, and Go. Importing a malicious egg or gaining access to wings instance could lead to cross site scripting (XSS) on the panel, which could be used to gain an administrator account on the panel. Specifically, the following things are impacted: Egg Docker images and Egg variables: Name, Environment variable, Default value, Description, Validation rules. Additionally, certain fields would reflect malicious input, but it would require the user knowingly entering such input to have an impact. To iterate, this would require an administrator to perform actions and can't be triggered by a normal panel user. This issue has has been addressed in version 1.11.6 and users are advised to upgrade. No workaround is available other than updating to the latest version of the panel.
Severity: nan (CVSS v3 base score: )
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/pterodactyl/panel
Files changed:
app/Http/Controllers/Admin/Nests/EggVariableController.php
app/Http/Controllers/Admin/Nests/NestController.php
app/Http/Controllers/Admin/NodesController.php
app/Http/Requests/Admin/Egg/EggFormRequest.php
app/Http/Requests/Admin/Nest/StoreNestFormRequest.php
app/Http/Requests/Api/Client/Servers/Settings/SetDockerImageRequest.php
app/Models/Egg.php
app/Models/Server.php
public/themes/pterodactyl/js/admin/new-server.js
resources/views/admin/servers/view/startup.blade.php
Commit message: admin: tweaks to validation and rendering


Vulnerable code:
            'variable' => $variable->name,
            'variable' => $variable->name,
        $this->alert->success(trans('admin/nests.notices.created', ['name' => $nest->name]))->flash();
        $this->alert->success(trans('admin/node.notices.unallocated_deleted', ['ip' => $request->input('ip')]))
            'docker_images' => ['required', 'string', 'max:191', 'regex:/^([a-zA-Z0-9 .#_\/\-]*)(\|*)([a-zA-Z0-9 .\/:@]*)$/'],
            'name' => 'required|string|min:1|max:191',
            'docker_image' => ['required', 'string', 'max:191', 'regex:/^([a-zA-Z0-9 .#_\/\-]*)(\|*)([a-zA-Z0-9 .\/:@]*)$/', Rule::in(array_values($server->egg->docker_images))],
        'docker_images.*' => ['required', 'string', 'max:191', 'regex:/^([a-zA-Z0-9 .#_\/\-]*)(\|*)([a-zA-Z0-9 .\/:@]*)$/'],
        'image' => ['required', 'string', 'max:191', 'regex:/^([a-zA-Z0-9 .#_\/\-]*)(\|*)([a-zA-Z0-9 .\/:@]*)$/'],
        opt.innerHTML = keys[i] + " (" + images[keys[i]] + ")";
                opt.innerHTML = keys[i] + " (" + images[keys[i]] + ")";

Fixed code:
            'variable' => htmlspecialchars($variable->name),
            'variable' => htmlspecialchars($variable->name),
        $this->alert->success(trans('admin/nests.notices.created', ['name' => htmlspecialchars($nest->name)]))->flash();
        $this->alert->success(trans('admin/node.notices.unallocated_deleted', ['ip' => htmlspecialchars($request->input('ip'))]))
            'docker_images' => ['required', 'string', 'regex:/^[\w#\.\/\- ]*\|*[\w\.\/\-:@ ]*$/im'],
            'name' => 'required|string|min:1|max:191|regex:/^[\w\- ]+$/',
            'docker_image' => ['required', 'string', 'max:191', 'regex:/^[\w#\.\/\- ]*\|*[\w\.\/\-:@ ]*$/', Rule::in(array_values($server->egg->docker_images))],
        'docker_images.*' => ['required', 'string', 'max:191', 'regex:/^[\w#\.\/\- ]*\|*[\w\.\/\-:@ ]*$/'],
        'image' => ['required', 'string', 'max:191', 'regex:/^[\w\.\/\-:@ ]*$/'],
        opt.innerText = keys[i] + " (" + images[keys[i]] + ")";
                opt.innerText = keys[i] + " (" + images[keys[i]] + ")";