Commit Graph
4808 Commits
Author SHA1 Message Date
robert dennis ea1818fab9 screen lookup cleanup 2026-10-08 16:53:56 -04:00
robert dennis 21c6071680 loader cleanup 2026-10-08 16:53:56 -04:00
robert dennis 1ba166e8a6 slot type cleanup 2026-10-08 16:53:56 -04:00
robert dennis b516dc3646 registry cleanup 2026-10-08 16:53:56 -04:00
robert dennis 8d4f47fa6a extensions facade 2026-10-08 16:53:56 -04:00
Sky Mulley ff9527a2e9 fix tests to pass 2026-10-08 09:54:19 +01:00
Sky Mulley 964e7c7647 fix chmod translations not existing 2026-10-08 09:53:55 +01:00
Sky Mulley 173f2da8c3 fix issue where chmod would be refused by wings due to it not being string typed 2026-10-08 09:43:07 +01:00
robert dennis f154449a80 console command cleanup 2026-10-07 16:32:56 -04:00
robert dennis db123d2fef provider registration fix 2026-10-07 16:32:56 -04:00
robert dennis bd2c62fc6f extension migration fixes 2026-10-07 16:27:19 -04:00
robert dennis fb08b51ae8 composer package checks 2026-10-07 16:22:56 -04:00
robert dennis 752a132773 composer autoloader guard 2026-10-07 16:16:18 -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
Sky Mulley 39ee950837 fix rendered route from matching something that no longer exists 2026-10-07 12:12:22 +01:00
Sky Mulley c4281195f9 fix issue where scheduled backups would crash the panel 2026-10-07 11:05:45 +01:00
Sky Mulley 570e92accc fix install extension as url tests not passing 2026-10-07 10:57:16 +01:00
Sky Mulley dd81db5d4d implement ability to set icon for extensions 2026-10-07 10:46:54 +01:00
Sky Mulley 393a14c40e fix issue where PTERODACTYL_FILES_MAX_EDIT_SIZE wouldn't be respected correctly 2026-10-07 09:29:10 +01:00
Anthony 178f8b64eb install extension via url 2026-10-06 23:31:44 -05:00
Joshua Piper 6f91bdbb54 Prevent leaking password reset token to reCAPTCHA (#7258)
Changes the panel's default `Referrer-Policy` from
`no-referrer-when-downgrade` to `strict-origin-when-cross-origin`.

Prevents path and query string being sent in `Referrer`, so Google don't
get our tasty password reset url tokens.

Nothing I could find in panel reads a referrer cross-origin, and Wings
checks Origin not Referrer.
2026-10-06 23:00:11 -04:00
DarkZmaj 7fc5934616 Stop extension builds from preloading lazy chunks from the site root (#7253)
## Problem

An extension built with the SDK Vite preset whose lazy screens share a
module requests its shared chunk from the site root. For example
`/chunk.api.Hb1egxRz.js` returns the single page app shell (status 200,
`text/html`), and the browser logs `Failed to load module script:
Expected a JavaScript module script but the server responded with a MIME
type of "text/html"`. The extension still works, because the real
imports are relative, but every page load that touches such a screen
produces failing requests and console errors.

## Reproduction

1. Scaffold an extension with `php artisan p:extension:make demo`.
2. Register two screens with `screens.register('a', () =>
import('./A'))` and `screens.register('b', () => import('./B'))`, where
both import the same helper module.
3. Build it and enable it, then open one of the screens with the browser
network panel open.

The built `dist/client.js` starts with a `__vite__mapDeps` list of bare
chunk file names. Vite's preload helper resolves those names against the
document, not against the bundle.

## Root cause

Vite emits a `modulepreload` dependency map for dynamic imports. The
preset does not turn it off, and the helper's base is the page URL, so
the extension's chunk names resolve to the site root.

## Fix

Set `build.modulePreload` to `false` in `defineExtensionConfig`. Chunks
import each other with relative URLs, which already resolve against the
bundle, so nothing else changes. Preloading is only a hint.

## Testing

* New test in `packages/sdk/vite.spec.ts` builds an entry with two lazy
imports that share a module and asserts that the output contains no
preload map. It fails before the change and passes after it.
* `npx vitest run packages/sdk/vite.spec.ts` passes.
* Checked in a browser: the failing requests for the shared chunk
disappear and the screens still load.

## Compatibility considerations

Extensions rebuilt with the new preset lose a performance hint only.
Existing builds keep working as before.
2026-10-06 22:48:26 -04:00
DarkZmaj 7c6327d58e Do not require PHP 8.4 for the extension OpenAPI generator script (#7252)
## Problem

`packages/sdk/openapi.spec.ts` ("extracts all four extension API areas
without matching another extension") fails on PHP 8.3 with `Call to
undefined function mb_trim()` from
`scripts/generate-extension-openapi.php`. `composer.json` allows PHP
`^8.3`, but `mb_trim()` only exists natively from PHP 8.4. The frontend
job of the Tests workflow uses PHP 8.4, so the failure is not visible
there.

## Reproduction

On PHP 8.3 (for example `shivammathur/setup-php` with `php-version:
8.3`) run `npm ci` and `npm test`. One test fails with `PHP Fatal error:
Uncaught Error: Call to undefined function mb_trim() in
scripts/generate-extension-openapi.php:76`.

## Root cause

The script is meant to run standalone, and it only loads the Composer
autoloader when YAML input or output is involved. The autoloader is what
provides the `mb_trim()` polyfill, so the JSON only path calls an
undefined function on PHP 8.3.

## Fix

Use `trim()` for the generated API title. The title is built from the
original title, a fixed separator and a validated extension id, so ASCII
whitespace trimming gives the same result and no longer depends on the
polyfill.

## Testing

* `npx vitest run packages/sdk/openapi.spec.ts` on PHP 8.3: the
extraction test now passes. (The second test in that file also fails on
my Windows machine for a separate reason that does not occur on Linux,
so it is not part of this change.)
* Linux CI on PHP 8.3 reproduced the original failure as the only
failing frontend test.

## Compatibility considerations

None. The output is the same for any normal title, which cannot start
with Unicode only whitespace.
2026-10-06 22:47:54 -04:00
DarkZmaj 13d7dfa819 Make the telemetry scheduler test independent of other nodes in the database (#7249)
## Problem

`Tests\Integration\Console\SchedulerTest` (telemetry is scheduled and
sent only when enabled, dataset true) fails when the whole integration
suite runs, with `Failed asserting that actual size 22 matches expected
size 2`. It passes when the file is run on its own.

## Reproduction

Run `vendor/bin/pest tests/Integration` on a fresh checkout of the 2.0
development branch with the settings from `.env.ci` (it fails the same
way on Linux with PHP 8.3 and 8.4 against MariaDB 11 and MySQL 8, and on
Windows). Run `vendor/bin/pest
tests/Integration/Console/SchedulerTest.php` alone and it passes.

## Root cause

The test creates one node and then asserts that exactly two HTTP
requests were recorded: the telemetry request and the request for that
node. When the scheduler test runs inside the full suite, other
integration tests have already left committed node rows in the database
(21 nodes existed when the test ran). The telemetry job fetches system
information from every node, so each of those nodes adds another
request. Only the telemetry URL was faked, so the extra requests were
real outbound connection attempts to the random addresses of the
leftover factory nodes.

## Fix

* Fake every other URL with an empty successful response, so the test
can never make real network requests.
* Assert what the test is about, which is that exactly one telemetry
request is sent, instead of the total number of requests. The existing
assertion that the telemetry payload contains the created node is kept.

## Testing

* `vendor/bin/pest tests/Integration/Console/SchedulerTest.php` passes.
* The full `vendor/bin/pest tests/Integration` run no longer reports
this test as failed (on Windows the remaining failures there come from
missing `pdo_sqlite` and POSIX file modes and are unrelated).

## Compatibility considerations

Test only change. No application code, configuration or behaviour is
touched.
2026-10-06 22:47:23 -04:00
Joshua Piper 66ce0f2a16 Fix 2 SFTP Lockout Ratelimit Bugs (#7257)
Fixes two SFTP lockout bugs:

- `ad374661f` moved the server lookup after the password check, so fake
server identifiers bypassed the rate limit.
- `24f340c9a` keyed the lockout on server + Wings IP, so anyone could
lock every user out of a server.

Unknown servers are now rejected before any credential check, and the
lockout is keyed on the normalised username + resolved server UUID.
2026-10-06 22:46:46 -04:00
robert dennis 4a6377c675 provider loading cleanup 2026-10-06 20:11:59 -04:00
robert dennis 368b4bf6a6 regex fixes 2026-10-06 20:11:59 -04:00
robert dennis 5a15f59eab console command fixes 2026-10-06 20:11:59 -04:00
robert dennis c1b7294469 autoload validation 2026-10-06 20:11:59 -04:00
robert dennis cd24c7fe04 action wrapping cleanup 2026-10-06 20:11:59 -04:00
robert dennis 37f9a531c4 dev command tweak 2026-10-06 20:11:59 -04:00
robert dennis dd1f20fc0a nginx tweaks 2026-10-06 20:11:59 -04:00
robert dennis 7db75f2e4a install handling cleanup 2026-10-06 20:11:59 -04:00
robert dennis ce6d0e1fe5 theme asset handling 2026-10-06 20:11:59 -04:00
robert dennis 23a05fc567 minor fixes 2026-10-06 20:11:59 -04:00
robert dennis 8ebfdf8119 settings cleanup 2026-10-06 20:11:59 -04:00
robert dennis 0899d6babb tighten setting file checks 2026-10-06 20:11:59 -04:00
robert dennis 16b0198593 extension route middleware tweaks 2026-10-06 20:11:59 -04:00
robert dennis db5f27bdcd route registration cleanup 2026-10-06 20:11:59 -04:00
Sky Mulley 4adda9b8df don't snap to bottom for new lines in console log 2026-10-06 23:10:31 +01:00
Sky Mulley 9bccb278a9 redirect to intended path after login 2026-10-06 23:05:44 +01:00
Sky Mulley faa806668b mask database password when viewing credentials 2026-10-06 22:32:56 +01:00
Sky Mulley b40a98afa7 don't force docker image selector to inherit the height of the startup parameter field 2026-10-06 22:26:11 +01:00
Sky Mulley 8461ffe454 fix issue where input rules could come off the container card if too long 2026-10-06 22:25:48 +01:00
Sky Mulley 879b3fa11c convert mobile navbar to dropdown, similar to admin 2026-10-06 21:23:17 +01:00
Sky Mulley 829639a316 properly handle extensions adding menu items causing nav to become too long to handle 2026-10-06 21:16:27 +01:00
Sky Mulley 7709f465ca fix issue where navigation labels can't include icons without shifting off centre 2026-10-06 21:09:12 +01:00
Sky Mulley d1c36c3fdd update site icons and favicon to new logo 2026-10-06 18:41:46 +01:00
robert dennis 1776bd4e92 performance tweaks 2026-10-06 13:17:53 -04:00
robert dennis e284c381aa asset handling cleanup 2026-10-06 12:20:52 -04:00