Files
pterodactyl-panel/config/filesystems.php
T
Sandip Ghimire bb4e89826e fix(security): harden path validation, session revocation, and request handling (#7255)
# Security, Validation & Session Improvements

## Changes

* **Hardened IP/CIDR validation**
* Properly handles invalid IP addresses and CIDR ranges during API key
creation.
* Invalid IP/CIDR data now fails safely instead of causing a 500 error.

* **Improved reCAPTCHA error handling**
  * Handles network and verification failures gracefully.
  * Fixed undefined result notices and removed duplicate checks.

* **Added file permission activity logging**
* File permission (`chmod`) changes are now recorded in the activity
log.

* **Removed duplicate 2FA middleware**
* Cleaned up duplicate `RequireTwoFactorAuthentication` registration
from API routes.

* **Improved session revocation on password changes**
  * Password changes now invalidate other active sessions.
* Rotates the `remember_token` and removes stale database sessions where
applicable.
* Applies consistently across password resets and user password changes.

* **Reduced unnecessary public storage access**
* Disabled automatic public storage routes for the local filesystem disk
to reduce the attack surface.

* **Hardened file manager request validation**
  * Added strict validation for file permission modes.
  * Fixed optional `root` validation rules.
  * Added length limits for file paths, roots, and file/folder names.

* **Hardened mount source and target path validation**
* Prevents path traversal and subpath-based bypasses in mount source and
target validation.
  * Handles trailing slashes and normalized paths correctly.
* Prevents mounts from targeting protected subdirectories, such as
another server's volume directory.
2026-10-07 12:39:12 -04:00

76 lines
2.4 KiB
PHP

<?php
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application for file storage.
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Below you may configure as many filesystem disks as necessary, and you
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
'serve' => false,
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];