[GH-ISSUE #2065] [Issue]: Admin Access loopback hardening flag is missing in refactor remote runtime #1012

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

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

Originally assigned to: @cha1latte on GitHub.

Summary

Refactor Remote Runtime always exempts loopback clients from per-command Admin Access checks, but legacy main had MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK to let operators require ADMIN_SECRET even for loopback privileged APIs.

Expected behavior

If the legacy hardening knob is still part of the remote-runtime security contract, refactor should preserve an equivalent setting for privileged loopback calls, or document the unconditional loopback exemption as an intentional divergence.

Actual behavior

Static parity tracing found the refactor Admin Access guard returns success for loopback before checking ADMIN_SECRET. No refactor equivalent of MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK was found during this slice.

Evidence:

  • Refactor src-tauri/src/http_server.rs skips Admin Access for privileged commands when is_loopback(ip) is true.
  • Refactor src-tauri/src/http_server.rs checks ADMIN_SECRET only after the loopback exemption.
  • Legacy packages/server/src/middleware/privileged-gate.ts skipped Admin Access on loopback only when isAdminSecretRequiredOnLoopback() was false.
  • Legacy packages/server/src/config/runtime-config.ts exposed MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK.

Steps to reproduce

  1. Run the refactor hostable Remote Runtime on loopback.
  2. Configure ADMIN_SECRET on the runtime.
  3. Call a privileged command such as backup_create, backup_delete, profile_import, admin_clear_all_command, or import_st_bulk_run from loopback without X-Admin-Secret.
  4. Compare with legacy main when MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true, where loopback privileged APIs still required the Admin Access secret.

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: refactor, Target 3 security parity scan on 2026-06-04
  • Run mode: remote runtime
  • OS + version: not app-proven
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not captured
  • Remote Runtime URL configured? yes
  • Provider, model, or integration, if relevant: privileged remote commands / Admin Access

Logs, screenshots, or video

No destructive runtime call was made. Static evidence only:

  • src-tauri/src/http_server.rs: require_admin_access_for_command returns early for loopback.
  • Legacy packages/server/src/middleware/privileged-gate.ts: loopback bypass depends on isAdminSecretRequiredOnLoopback().
  • Legacy packages/server/src/config/runtime-config.ts: MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK.

Regression notes

Legacy main supported an explicit loopback-hardening mode for privileged APIs. Refactor preserves Admin Access for non-loopback privileged commands but appears to drop that opt-in loopback requirement.

Related tracker: #2050.

Additional context

This is lower priority than missing Admin Access on remote import_st_bulk_scan, because loopback is normally trusted. It still matters for users who run browser shells, local reverse proxies, containers, or shared workstations and deliberately enabled the legacy hardening flag.

Suggested fix: add a refactor env flag equivalent to MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK and cover one privileged loopback command with both bypass-default and require-secret-enabled tests.

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 @Promansis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2065 Originally assigned to: @cha1latte on GitHub. ## Summary Refactor Remote Runtime always exempts loopback clients from per-command Admin Access checks, but legacy `main` had `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK` to let operators require `ADMIN_SECRET` even for loopback privileged APIs. ## Expected behavior If the legacy hardening knob is still part of the remote-runtime security contract, refactor should preserve an equivalent setting for privileged loopback calls, or document the unconditional loopback exemption as an intentional divergence. ## Actual behavior Static parity tracing found the refactor Admin Access guard returns success for loopback before checking `ADMIN_SECRET`. No refactor equivalent of `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK` was found during this slice. Evidence: - Refactor `src-tauri/src/http_server.rs` skips Admin Access for privileged commands when `is_loopback(ip)` is true. - Refactor `src-tauri/src/http_server.rs` checks `ADMIN_SECRET` only after the loopback exemption. - Legacy `packages/server/src/middleware/privileged-gate.ts` skipped Admin Access on loopback only when `isAdminSecretRequiredOnLoopback()` was false. - Legacy `packages/server/src/config/runtime-config.ts` exposed `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK`. ## Steps to reproduce 1. Run the refactor hostable Remote Runtime on loopback. 2. Configure `ADMIN_SECRET` on the runtime. 3. Call a privileged command such as `backup_create`, `backup_delete`, `profile_import`, `admin_clear_all_command`, or `import_st_bulk_run` from loopback without `X-Admin-Secret`. 4. Compare with legacy `main` when `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true`, where loopback privileged APIs still required the Admin Access secret. ## 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: `refactor`, Target 3 security parity scan on 2026-06-04 - Run mode: remote runtime - OS + version: not app-proven - Node + pnpm versions: not relevant - Rust version, if relevant: not captured - Remote Runtime URL configured? yes - Provider, model, or integration, if relevant: privileged remote commands / Admin Access ## Logs, screenshots, or video No destructive runtime call was made. Static evidence only: - `src-tauri/src/http_server.rs`: `require_admin_access_for_command` returns early for loopback. - Legacy `packages/server/src/middleware/privileged-gate.ts`: loopback bypass depends on `isAdminSecretRequiredOnLoopback()`. - Legacy `packages/server/src/config/runtime-config.ts`: `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK`. ## Regression notes Legacy `main` supported an explicit loopback-hardening mode for privileged APIs. Refactor preserves Admin Access for non-loopback privileged commands but appears to drop that opt-in loopback requirement. Related tracker: #2050. ## Additional context This is lower priority than missing Admin Access on remote `import_st_bulk_scan`, because loopback is normally trusted. It still matters for users who run browser shells, local reverse proxies, containers, or shared workstations and deliberately enabled the legacy hardening flag. Suggested fix: add a refactor env flag equivalent to `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK` and cover one privileged loopback command with both bypass-default and require-secret-enabled tests. ## 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:25:08 +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#1012
No description provided.