mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1920] [Issue]: remote runtime privileged commands do not use Admin Access guard #937
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#937
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xelvanis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1920
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Remote
/api/invokeexposes several high-risk commands through the hostable runtime, but the refactor path does not currently have a per-command Admin Access /ADMIN_SECRETguard equivalent to the legacy protected server routes.Expected behavior
Remote runtime calls that create backups, import profiles, browse server folders, apply updates, or clear/expunge data should require the same privileged-access boundary as the legacy server surface, or they should be explicitly documented as covered by a different refactor security model.
Actual behavior
Static inspection on current
origin/refactorshows:src/shared/api/remote-runtime.tsallowlists high-risk commands includingprofile_import,profile_import_upload,backup_create,backup_delete,backup_download,import_list_directory,admin_expunge_command,admin_clear_all_command, andupdate_apply.src-tauri/src/http_dispatch.rsdispatches those commands directly through/api/invoke.src-tauri/src/http_server.rsapplies global hostable runtime checks for IP allowlist, Basic Auth, and browser-origin CSRF, but there is no per-command Admin Access /ADMIN_SECRETcheck in the dispatch path.marinara-admin-secretlocally, but the shared API wrappers do not send an admin header to/api/invoke.Legacy server routes used
requirePrivilegedAccessfor comparable high-risk endpoints such as admin expunge/clear-all, backup create/delete/download, profile import/export, bulk import, folder browsing, update apply, and haptic control.Steps to reproduce
src/shared/api/remote-runtime.ts.src-tauri/src/http_dispatch.rs.src-tauri/src/http_server.rs.requirePrivilegedAccessinpackages/server/src/routes/*.No destructive runtime call was made for this report.
Impact area
Environment
origin/refactorat0afe673/api/invokeLogs, screenshots, or video
No runtime screenshot attached. Static evidence:
src/shared/api/remote-runtime.ts: remote allowlist includes the high-risk commands named above.src-tauri/src/http_dispatch.rs:/api/invokedispatches those commands.src-tauri/src/http_server.rs: hostable middleware enforces global IP/auth/CSRF checks.src/features/shell/settings/components/SettingsPanel.tsx: Admin Access persists anADMIN_SECRETvalue locally.src/shared/api/admin-api.ts: admin clear/expunge wrappers callinvokeTauriwithout an admin-access argument.packages/server/src/middleware/privileged-gate.tsand protected routes requireX-Admin-Secretfor privileged operations outside the loopback exception.Regression notes
This overlaps the hostable-runtime security lane in #1855, but it is a focused current refactor issue. It does not affect public release builds while refactor remains unreleased.
Additional context
Suggested fix:
invokeRemoteor to specific shared API wrappers.http_server.rsorhttp_dispatch.rsbefore dispatching high-risk commands.Related tracker: #1904 target 3, remote runtime parity.
Template check
@SpicyMarinara commented on GitHub (Jun 2, 2026):
Fixed on refactor in
a4ba3c90: privileged remote commands now require Admin Access on non-loopback clients via X-Admin-Secret/ADMIN_SECRET, and the remote client sends the stored Admin Access secret for privileged commands. Verification passed: typecheck, architecture, docs, build, cargo check, diff check.