Improve security posture, update dependencies (#5569)

Very minor changes, just adding some default headers in the event people
don't configure this on their webserver. Also updating some packages to
resolve open security alerts.
This commit is contained in:
Dane Everitt
2026-02-14 11:18:17 -08:00
committed by GitHub
parent 0e74f3aade
commit 14185a9430
5 changed files with 662 additions and 299 deletions
+2
View File
@@ -14,6 +14,7 @@ use Pterodactyl\Http\Middleware\VerifyCsrfToken;
use Pterodactyl\Http\Middleware\VerifyReCaptcha;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Pterodactyl\Http\Middleware\LanguageMiddleware;
use Pterodactyl\Http\Middleware\SetSecurityHeaders;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Pterodactyl\Http\Middleware\Activity\TrackAPIKey;
@@ -46,6 +47,7 @@ class Kernel extends HttpKernel
ValidatePostSize::class,
TrimStrings::class,
ConvertEmptyStringsToNull::class,
SetSecurityHeaders::class,
];
protected $middlewarePriority = [
@@ -0,0 +1,43 @@
<?php
namespace Pterodactyl\Http\Middleware;
use Illuminate\Http\Request;
class SetSecurityHeaders
{
/**
* Ideally we move away from X-Frame-Options/X-XSS-Protection and implement a
* proper standard CSP, but I can guarantee that will break for a lot of folks
* using custom plugins and who knows what image embeds.
*
* We'll circle back to that at a later date when it can be more fully controlled
* by the admin to support those cases without too much trouble.
*/
private static array $headers = [
'X-Frame-Options' => 'DENY',
'X-Content-Type-Options' => 'nosniff',
'X-XSS-Protection' => '1; mode=block',
'Referrer-Policy' => 'no-referrer-when-downgrade',
];
/**
* Enforces some basic security headers on all responses returned by the software.
* If a header has already been set in another location within the code it will be
* skipped over here.
*
* @param (\Closure(mixed): \Illuminate\Http\Response) $next
*/
public function handle(Request $request, \Closure $next): mixed
{
$response = $next($request);
foreach (static::$headers as $key => $value) {
if (! $response->headers->has($key)) {
$response->headers->set($key, $value);
}
}
return $response;
}
}
+2 -2
View File
@@ -24,7 +24,7 @@
"ext-pdo_mysql": "*",
"ext-posix": "*",
"ext-zip": "*",
"aws/aws-sdk-php": "^3.366.2",
"aws/aws-sdk-php": "^3.369",
"guzzlehttp/guzzle": "^7.9.2",
"hashids/hashids": "^5.0.2",
"laracasts/utilities": "~3.2.3",
@@ -62,7 +62,7 @@
"nunomaduro/collision": "^8.5",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^10.5",
"phpunit/phpunit": "^10.5.62",
"spatie/laravel-ignition": "^2.9"
},
"autoload": {
Generated
+35 -35
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8e16604b86b909074ebd8ae0800fcd16",
"content-hash": "4040741d3196c70ae44e03a7cdfca6e4",
"packages": [
{
"name": "aws/aws-crt-php",
@@ -62,16 +62,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.366.2",
"version": "3.369.34",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "de3b25e2d86aa081814e198fe5cde4ef0ff7f879"
"reference": "5db21cd0e5c8a5b5344596649033acf861a5e117"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/de3b25e2d86aa081814e198fe5cde4ef0ff7f879",
"reference": "de3b25e2d86aa081814e198fe5cde4ef0ff7f879",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5db21cd0e5c8a5b5344596649033acf861a5e117",
"reference": "5db21cd0e5c8a5b5344596649033acf861a5e117",
"shasum": ""
},
"require": {
@@ -85,7 +85,7 @@
"mtdowling/jmespath.php": "^2.8.0",
"php": ">=8.1",
"psr/http-message": "^1.0 || ^2.0",
"symfony/filesystem": "^v6.4.3 || ^v7.1.0 || ^v8.0.0"
"symfony/filesystem": "^v5.4.45 || ^v6.4.3 || ^v7.1.0 || ^v8.0.0"
},
"require-dev": {
"andrewsville/php-token-reflection": "^1.4",
@@ -153,9 +153,9 @@
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.366.2"
"source": "https://github.com/aws/aws-sdk-php/tree/3.369.34"
},
"time": "2025-12-05T19:09:22+00:00"
"time": "2026-02-13T19:09:12+00:00"
},
{
"name": "brick/math",
@@ -4302,16 +4302,16 @@
},
{
"name": "psy/psysh",
"version": "v0.12.15",
"version": "v0.12.20",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "38953bc71491c838fcb6ebcbdc41ab7483cd549c"
"reference": "19678eb6b952a03b8a1d96ecee9edba518bb0373"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/38953bc71491c838fcb6ebcbdc41ab7483cd549c",
"reference": "38953bc71491c838fcb6ebcbdc41ab7483cd549c",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/19678eb6b952a03b8a1d96ecee9edba518bb0373",
"reference": "19678eb6b952a03b8a1d96ecee9edba518bb0373",
"shasum": ""
},
"require": {
@@ -4319,8 +4319,8 @@
"ext-tokenizer": "*",
"nikic/php-parser": "^5.0 || ^4.0",
"php": "^8.0 || ^7.4",
"symfony/console": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4",
"symfony/var-dumper": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4"
"symfony/console": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4",
"symfony/var-dumper": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4"
},
"conflict": {
"symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4"
@@ -4375,9 +4375,9 @@
],
"support": {
"issues": "https://github.com/bobthecow/psysh/issues",
"source": "https://github.com/bobthecow/psysh/tree/v0.12.15"
"source": "https://github.com/bobthecow/psysh/tree/v0.12.20"
},
"time": "2025-11-28T00:00:14+00:00"
"time": "2026-02-11T15:05:28+00:00"
},
{
"name": "ralouphie/getallheaders",
@@ -7121,16 +7121,16 @@
},
{
"name": "symfony/process",
"version": "v7.4.0",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "7ca8dc2d0dcf4882658313aba8be5d9fd01026c8"
"reference": "608476f4604102976d687c483ac63a79ba18cc97"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/7ca8dc2d0dcf4882658313aba8be5d9fd01026c8",
"reference": "7ca8dc2d0dcf4882658313aba8be5d9fd01026c8",
"url": "https://api.github.com/repos/symfony/process/zipball/608476f4604102976d687c483ac63a79ba18cc97",
"reference": "608476f4604102976d687c483ac63a79ba18cc97",
"shasum": ""
},
"require": {
@@ -7162,7 +7162,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v7.4.0"
"source": "https://github.com/symfony/process/tree/v7.4.5"
},
"funding": [
{
@@ -7182,7 +7182,7 @@
"type": "tidelift"
}
],
"time": "2025-10-16T11:21:06+00:00"
"time": "2026-01-26T15:07:59+00:00"
},
{
"name": "symfony/routing",
@@ -10032,16 +10032,16 @@
},
{
"name": "phpunit/phpunit",
"version": "10.5.59",
"version": "10.5.63",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c47fe00df06fb1f68399ef7386edb01c25132473"
"reference": "33198268dad71e926626b618f3ec3966661e4d90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c47fe00df06fb1f68399ef7386edb01c25132473",
"reference": "c47fe00df06fb1f68399ef7386edb01c25132473",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/33198268dad71e926626b618f3ec3966661e4d90",
"reference": "33198268dad71e926626b618f3ec3966661e4d90",
"shasum": ""
},
"require": {
@@ -10062,7 +10062,7 @@
"phpunit/php-timer": "^6.0.0",
"sebastian/cli-parser": "^2.0.1",
"sebastian/code-unit": "^2.0.0",
"sebastian/comparator": "^5.0.4",
"sebastian/comparator": "^5.0.5",
"sebastian/diff": "^5.1.1",
"sebastian/environment": "^6.1.0",
"sebastian/exporter": "^5.1.4",
@@ -10113,7 +10113,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.59"
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.63"
},
"funding": [
{
@@ -10137,7 +10137,7 @@
"type": "tidelift"
}
],
"time": "2025-12-01T07:37:23+00:00"
"time": "2026-01-27T05:48:37+00:00"
},
{
"name": "react/cache",
@@ -10835,16 +10835,16 @@
},
{
"name": "sebastian/comparator",
"version": "5.0.4",
"version": "5.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "e8e53097718d2b53cfb2aa859b06a41abf58c62e"
"reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e8e53097718d2b53cfb2aa859b06a41abf58c62e",
"reference": "e8e53097718d2b53cfb2aa859b06a41abf58c62e",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d",
"reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d",
"shasum": ""
},
"require": {
@@ -10900,7 +10900,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"security": "https://github.com/sebastianbergmann/comparator/security/policy",
"source": "https://github.com/sebastianbergmann/comparator/tree/5.0.4"
"source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5"
},
"funding": [
{
@@ -10920,7 +10920,7 @@
"type": "tidelift"
}
],
"time": "2025-09-07T05:25:07+00:00"
"time": "2026-01-24T09:25:16+00:00"
},
{
"name": "sebastian/complexity",
+580 -262
View File
File diff suppressed because it is too large Load Diff