[GH-ISSUE #2039] [Issue]: Remote backup listing exposes local backup paths without Admin Access #999

Closed
opened 2026-10-21 05:24:59 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2039

Originally assigned to: @cha1latte on GitHub.

Summary

Remote Runtime exposes backup_list through /api/invoke, but it is not in the privileged remote command set. The command returns each managed backup's local filesystem path, so a non-loopback remote client that passes the general runtime auth layer can enumerate server backup paths without Admin Access.

Expected behavior

Backup listing should match legacy exposure and remote privilege expectations:

  • Remote backup_list should either require the same Admin Access gate as backup create/delete/download, or return only non-sensitive metadata.
  • The response should not expose server-local backup paths unless the caller has privileged access and the path is explicitly needed.
  • Remote allowlist and privileged-command tests should cover backup_list as a negative control.

Actual behavior

  • src/shared/api/remote-runtime.ts includes backup_list in REMOTE_COMMANDS.
  • backup_list is missing from PRIVILEGED_REMOTE_COMMANDS and from src-tauri/src/http_server.rs::is_privileged_remote_command.
  • src-tauri/src/commands/storage/backup.rs::backup_entry returns { name, createdAt, path }.
  • Legacy packages/server/src/routes/backup.routes.ts listed backups as { name, createdAt } and did not return the server path.

Steps to reproduce

  1. Run a Remote Runtime with non-loopback access configured and at least one managed backup.
  2. Call POST /api/invoke with { "command": "backup_list", "args": {} } using normal runtime access but without X-Admin-Secret.
  3. Observe that the call is not rejected by the Admin Access gate and backup entries include local path values.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: origin/refactor at 86c9b8c9
  • Run mode: remote runtime
  • OS + version: not OS-specific
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? yes
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Focused proof from the storage parity scan:

  • cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands -- --nocapture -> 1 passed, confirming the current allowlist shape includes backup_list.
  • cargo test --manifest-path src-tauri/Cargo.toml http_server::tests::hostable_security_ -- --nocapture -> 10 passed for the general remote auth/CSRF layer, but there is no focused negative test for backup_list requiring Admin Access.

Static comparison:

  • Refactor backup_entry includes path in list responses.
  • Legacy backup listing returned only name and createdAt.

Regression notes

Legacy backup listing did not expose the server-local backup path. The refactor adds path to the list payload and exposes the command remotely without the Admin Access privilege tier.

Additional context

Suggested fix:

  • Add backup_list to both privileged command sets, or remove path from the public/list response and keep local filesystem paths only for embedded/internal flows.
  • Add a remote Admin Access negative test for backup_list beside the existing privileged-command guard tests.

Related tracker: #2028 Target 2 storage parity, cross-target handoff scan.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2039 Originally assigned to: @cha1latte on GitHub. ## Summary Remote Runtime exposes `backup_list` through `/api/invoke`, but it is not in the privileged remote command set. The command returns each managed backup's local filesystem `path`, so a non-loopback remote client that passes the general runtime auth layer can enumerate server backup paths without Admin Access. ## Expected behavior Backup listing should match legacy exposure and remote privilege expectations: - Remote `backup_list` should either require the same Admin Access gate as backup create/delete/download, or return only non-sensitive metadata. - The response should not expose server-local backup paths unless the caller has privileged access and the path is explicitly needed. - Remote allowlist and privileged-command tests should cover `backup_list` as a negative control. ## Actual behavior - `src/shared/api/remote-runtime.ts` includes `backup_list` in `REMOTE_COMMANDS`. - `backup_list` is missing from `PRIVILEGED_REMOTE_COMMANDS` and from `src-tauri/src/http_server.rs::is_privileged_remote_command`. - `src-tauri/src/commands/storage/backup.rs::backup_entry` returns `{ name, createdAt, path }`. - Legacy `packages/server/src/routes/backup.routes.ts` listed backups as `{ name, createdAt }` and did not return the server path. ## Steps to reproduce 1. Run a Remote Runtime with non-loopback access configured and at least one managed backup. 2. Call `POST /api/invoke` with `{ "command": "backup_list", "args": {} }` using normal runtime access but without `X-Admin-Secret`. 3. Observe that the call is not rejected by the Admin Access gate and backup entries include local `path` values. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `origin/refactor` at `86c9b8c9` - Run mode: remote runtime - OS + version: not OS-specific - Node + pnpm versions: not relevant - Rust version, if relevant: not relevant - Remote Runtime URL configured? yes - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Focused proof from the storage parity scan: - `cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands -- --nocapture` -> 1 passed, confirming the current allowlist shape includes `backup_list`. - `cargo test --manifest-path src-tauri/Cargo.toml http_server::tests::hostable_security_ -- --nocapture` -> 10 passed for the general remote auth/CSRF layer, but there is no focused negative test for `backup_list` requiring Admin Access. Static comparison: - Refactor `backup_entry` includes `path` in list responses. - Legacy backup listing returned only `name` and `createdAt`. ## Regression notes Legacy backup listing did not expose the server-local backup path. The refactor adds `path` to the list payload and exposes the command remotely without the Admin Access privilege tier. ## Additional context Suggested fix: - Add `backup_list` to both privileged command sets, or remove `path` from the public/list response and keep local filesystem paths only for embedded/internal flows. - Add a remote Admin Access negative test for `backup_list` beside the existing privileged-command guard tests. Related tracker: #2028 Target 2 storage parity, cross-target handoff scan. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:24:59 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#999
No description provided.