Commit Graph
28 Commits
Author SHA1 Message Date
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
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 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
Matthew PennerandDaneEveritt cbcf62086f Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00
DaneEveritt c14c7b436e Pass along new fields to Wings instance when endpoint is used; closes #4048 2022-05-28 13:45:23 -04:00
DaneEveritt e313dff674 Massively simplify API binding logic
Changes the API internals to use normal Laravel binding which automatically supports nested-models and can determine their relationships. This removes a lot of confusingly complex internal logic and replaces it with standard Laravel code.

This also removes a deprecated "getModel" method and fully replaces it with a "parameter" method that does stricter type-checking.
2022-05-22 14:10:01 -04:00
Dane Everitt c449ca5155 Use more standardized phpcs 2021-01-23 12:33:34 -08:00
Dane Everitt 087c41d5ac Add endpoint to pull a remote file down 2020-12-24 09:15:03 -08:00
Matthew Penner 3e1dbbaedd Fix validation rules for ChmodFilesRequest.php, again.. 2020-12-04 09:24:06 -07:00
Matthew Penner bd0b7127d2 Fix validation rules for ChmodFilesRequest.php 2020-12-04 09:24:06 -07:00
Matthew Penner 8611ebb2d6 Add /api/client/servers/{server}/files/chmod endpoint 2020-12-04 09:24:06 -07:00
Dane Everitt 981edb0d64 Require specific permission for reading the actual contents of a file; ref #2288 2020-08-31 19:36:30 -07:00
Dane Everitt 54f9c5f187 Merge branch 'develop' into feature/file-uploads 2020-08-22 18:33:09 -07:00
Dane Everitt 1a6669aa5c Add endpoint support for decompressing files 2020-07-14 21:16:49 -07:00
Matthew Penner 1d2acbd5b4 Get basic file upload functionality working 2020-07-12 16:42:32 -06:00
Dane Everitt 2653321fc2 Support renaming multiple files at once 2020-07-11 16:00:30 -07:00
Dane Everitt 93cab68cc3 Handle mass actions for file deletion 2020-07-11 15:37:59 -07:00
Dane Everitt 82bc9e617b Add support for compressing items in the file manager 2020-07-11 13:38:49 -07:00
Dane Everitt 23d594f655 Update all of the permissions checking to be constant based 2020-03-22 15:31:25 -07:00
Dane Everitt 867dbf3bd2 Update all the client API endpoints to use new permissions codes 2019-11-03 17:13:47 -08:00
Dane Everitt bfdc1f766b Support saving existing files 2019-05-27 15:30:49 -07:00
Dane Everitt a8462bf109 Add initial support for opening a file in the file manager, still needs more work 2019-05-25 16:24:13 -07:00
Dane Everitt d79fe6982f Add support for file copy and deletion 2019-05-04 17:26:24 -07:00
Dane Everitt 811026895b Update support for moving/renaming files and folders 2019-05-04 16:04:59 -07:00
Dane Everitt 95d19bf09e Update logic that handles creation of folders for a server 2019-05-01 21:45:39 -07:00
Dane Everitt c80c8564b8 Switch file manager listing to use panel API endpoint 2019-05-01 20:54:40 -07:00
Dane Everitt 8955b5a660 Initial attempt trying to get file downloading to work 2019-03-16 17:10:04 -07:00