Commit Graph
267 Commits
Author SHA1 Message Date
robert dennis e467b4b5ff review fixes 2026-11-05 15:10:39 -05:00
robert dennis a0a0bb99ab avatar actions 2026-10-20 15:55:48 -04:00
robert dennis f7aa208cab fix ci 2026-10-20 15:46:16 -04:00
ItzLinaton 60b72365d8 Feat: Custom User Avatars (V2) (#7295)
Added custom user avatar support.

## Extra Details:
- Users can upload custom `PNG, JPEG, SVG, WebP, AVIF`, and `ICO`
avatars.
- Added avatar management to the user account area.
- Added admin controls to update and remove user avatars.
- Custom User avatars appear in:
  - Panel Navbar.
  - Panel Admin Activity Logs.
  - Server Sub user List.
  - Server Activity Logs
  - Personal Account Activity Logs.
  - Server Ownership Details.
  
---

<img width="1329" height="327"
alt="{B32EBD7F-1FCA-4356-966C-0D60A9A23E49}"
src="https://github.com/user-attachments/assets/881fa5b3-9599-4370-975d-83b6bd91a7d1"
/>

---

<img width="997" height="847" alt="adminpage"
src="https://github.com/user-attachments/assets/989acbcc-351c-431b-ab7f-557ba4c7e070"
/>

---

<img width="955" height="781" alt="serverinfo"
src="https://github.com/user-attachments/assets/6556afac-1971-4112-9686-b71137072c5f"
/>

---

<img width="1376" height="919" alt="userarea"
src="https://github.com/user-attachments/assets/d49f0ddb-1f38-4884-b186-8db78bfed4b0"
/>

---

<img width="936" height="232" alt="userslist"
src="https://github.com/user-attachments/assets/0e8a4b4a-719a-4d52-a485-d7577736b43f"
/>

---

<img width="983" height="772" alt="activity"
src="https://github.com/user-attachments/assets/37ef7176-a804-43f7-ae32-ae65e1a2671b"
/>
2026-10-20 15:09:33 -04:00
robert dennis 643267c7cf activity facets 2026-10-12 05:18:58 -04:00
robert dennis 9ec637c6bb node jwt 2026-10-12 05:18:58 -04:00
robert dennis c1183db698 activity queries 2026-10-12 05:18:58 -04:00
robert dennis e5f51dc327 server helpers 2026-10-12 05:18:58 -04:00
robert dennis 94c311529b node jwt 2026-10-12 05:18:58 -04:00
robert dennis 2705126612 client resources: server data 2026-10-12 05:18:58 -04:00
robert dennis fa117372fb client resources: servers 2026-10-12 05:18:58 -04:00
robert dennis e2bd15ea3a client resources: account 2026-10-12 05:18:57 -04:00
robert dennis 987eab6f72 drop json guard 2026-10-12 05:18:57 -04:00
robert dennis ae296bda86 drop json aliases 2026-10-12 05:18:57 -04:00
robert dennis d5b8268411 include parsing 2026-10-12 05:18:57 -04:00
robert dennis d823ff24cd typed request input 2026-10-12 05:18:57 -04:00
robert dennis 26463b47e4 account key activity 2026-10-12 05:18:56 -04:00
robert dennis 7fcaeae4d3 account activity 2026-10-12 05:18:56 -04:00
robert dennis 380bc9a4ed subuser activity 2026-10-12 05:18:56 -04:00
robert dennis 03b3e2252e user create activity 2026-10-12 05:18:56 -04:00
robert dennis 894249cab9 file activity 2026-10-12 05:18:56 -04:00
robert dennis d0d833ff2c backup activity 2026-10-12 05:18:56 -04:00
robert dennis bdfdab5d3d allocation activity 2026-10-12 05:18:56 -04:00
robert dennis 84695d2f0a database activity 2026-10-12 05:18:56 -04:00
robert dennis a84924539a server settings activity 2026-10-12 05:18:56 -04:00
robert dennis 50904d0e6a power activity 2026-10-12 05:18:56 -04:00
robert dennis ac7f9a889a backup actions 2026-10-12 05:18:56 -04:00
robert dennis ac79b03483 server details action 2026-10-12 05:18:56 -04:00
robert dennis b362df4c5f api key actions 2026-10-12 05:18:56 -04:00
robert dennis 735308cdd3 database actions 2026-10-12 05:18:56 -04:00
robert dennis 492a5a4f40 schedule actions 2026-10-12 05:18:55 -04:00
robert dennis 77ec6c14a4 account key actions 2026-10-12 05:18:55 -04:00
robert dennis 1a4b6b1a4f startup variable action 2026-10-12 05:18:55 -04:00
robert dennis d5b3f4fdce delete logging 2026-10-12 05:18:55 -04:00
robert dennis feebc11056 boolean inputs 2026-10-12 05:18:54 -04:00
robert dennis 135b298560 alpha cleanup 2026-10-08 19:17:30 -04:00
robert dennis e217e42360 complexity cleanup 2026-10-08 18:49:15 -04:00
robert dennis 56fb932a73 action cleanup 2026-10-08 17:40:00 -04:00
robert dennis bc50a8bbeb backend cleanup 2026-10-08 17:22:14 -04:00
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
DarkZmaj be0509dfb7 Apply the Rector changes reported on the current branch (#7251)
## Problem

`vendor/bin/rector --dry-run` reports three files that would change,
which fails the Static Analysis job of the Tests workflow.

## Reproduction

Run `vendor/bin/rector --dry-run --no-progress-bar` on a clean checkout
with PHP 8.4, as the workflow does. Rector lists `PasswordBroker.php`,
`PasswordBrokerManager.php` and `FileController.php`. With PHP 8.3 the
command reports nothing, because some rules depend on the running PHP
version.

## Root cause

Recent changes in these three files were merged without running Rector,
so they differ from the style the project enforces.

## Fix

Apply exactly the changes Rector prints:

* `PasswordBroker`: compare the callback with `instanceof Closure`
instead of `!== null`.
* `PasswordBrokerManager`: use `throw_unless` and `throw_if` with the
exception class string.
* `FileController`: name the caught exception
`$daemonConnectionException` after its type.

## Testing

* `vendor/bin/rector --dry-run` no longer reports changes locally, and
PHPStan and Pint still pass.
* The authentication integration tests and the server file integration
tests pass (86 tests).
* I could not run Rector under PHP 8.4 locally, so the Static Analysis
job of this pull request is the confirmation.

## Compatibility considerations

Behaviour is unchanged. The `instanceof Closure` check is stricter than
a null check only for callbacks that are not closures, and the parameter
is already typed as a nullable closure.
2026-10-06 15:16:49 +01:00
Sky Mulley 240aaf62ea properly handle file permissions regarding to creation and updating 2026-10-06 13:51:34 +01:00
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00
Noah Ross a94b8bdb4e Fix API Key Limit Race Condition Bypass (#5620)
The API key creation endpoint checks that a user has fewer than 25 keys
before creating a new one. The problem is that the count was read from
an eager-loaded collection (`$user->apiKeys->count()`) with no lock
held, so concurrent requests could both pass the check and each create a
key, pushing the user past the 25-key cap.

The fix wraps the count check and key creation in a single database
transaction with `lockForUpdate()` on the query. Only one request at a
time can evaluate and modify the count, closing the race window.

### Proof of Concept

Run this in the browser console while authenticated with a user that has
24 API keys:

```js
(async () => {
    const makeKey = (desc) => fetch('/api/client/account/api-keys', {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'X-Requested-With': 'XMLHttpRequest',
        'X-XSRF-TOKEN':
  decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)[1]),
      },
      body: JSON.stringify({ description: desc, allowed_ips: [] }),
    });

    const [r1, r2] = await Promise.all([makeKey('0024'), makeKey('0025')]);
    console.log('0024:', r1.status, (await r1.text()).slice(0, 200));
    console.log('0025:', r2.status, (await r2.text()).slice(0, 200));
})();
```

On the old code, both requests can return 200 (you may need to run this
a few times to hit the race window). After the fix, the second request
correctly returns a 400 error.
2026-05-23 11:16:18 -07:00
Dane Everitt 7ffcd63631 Attach a scope(s) to JWTs created by the panel (#5636)
Necessary for proper token identification on Wings.
2026-05-23 11:15:36 -07:00
Dane Everitt ec7231bd4a Lock resources more explicitly when creating databases or backups (#5613)
Addresses an issue where the concept of a lock was there, but no actual
lock was acquired.
2026-04-01 18:46:01 -07:00
Dane Everitt 56fe10fdd6 Throttle email address changes on accounts to limit enumeration (#5612)
This change applies a rate limit to account email changes to prevent
enumeration on the system. The throttle is applied at the account level.
Administrators can still update an account's email address manually to
bypass this restriction if/when necessary.
2026-04-01 17:54:30 -07:00
Daniel Barton 51bbd10a01 Fix: Compare to correct variable in startup variable activity log (#5605)
- Fixes issue where the panel would create activity logs even when the
value didn't change
- Log an empty string instead of displaying "null" when the variable is
empty

Closes #5604
2026-03-26 16:24:02 -07:00
Dane Everitt 0e74f3aade Improve SFTP session revocation to cover password changes and account deletion (#5568)
This expands upon previous work done to better disconnect users from
SFTP when different events occur within Pterodactyl. This new logic also
accounts for password changes and their account being deleted entirely
from the system.

These events now trigger background jobs that will reach out to every
node they are associated with to ensure they're disconnected if
currently connected.
2026-02-14 10:51:26 -08:00
Всеволод МельникandDaneEveritt 09caa0d499 Merge commit from fork
* Add throttling to resource creation endpoints

* Fix middleware registration for the throttlers

* Lock the server's resource models when adding new ones

* Throttle subusers even more

---------

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2026-01-05 16:05:38 -08:00