mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 21:43:05 +09:00
The 1.7.68 RBAC fix enforced files.read on read endpoints, but the default viewer role legitimately has files.read=true, and on the documented install.sh layout the panel install dir (/opt/serverkit) sits under the allowed root /opt. A viewer could read the backend .env, steal JWT_SECRET_KEY / SERVERKIT_ENCRYPTION_KEY, and forge admin sessions. FileService now carries PROTECTED_ROOTS (the panel install dir and SERVERKIT_CONFIG_DIR), checked inside is_path_allowed before the ALLOWED_ROOTS test, so every file-manager operation (read, write, browse, download, upload, ...) refuses panel-internal paths for every role. Regression tests: protected paths rejected by is_path_allowed; viewer read/download of the backend .env returns 403; allowed roots keep working. Co-authored-by: CaptBoykin <CaptBoykin@users.noreply.github.com>