[PR #2082] [MERGED] Protect remote bulk scan with Admin Access #5424

Closed
opened 2026-10-22 04:16:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2082
Author: @cha1latte
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2058-bulk-scan-admin


📝 Commits (1)

  • 2c15635 Protect remote bulk scan with Admin Access

📊 Changes

2 files changed (+32 additions, -0 deletions)

View changed files

📝 src-tauri/src/http_server.rs (+31 -0)
📝 src/shared/api/remote-runtime.ts (+1 -0)

📄 Description

Linked issue

Closes #2058

Why this change

  • Remote Runtime exposed import_st_bulk_scan, but the Admin Access privileged command sets only covered import_st_bulk_run. Off-loopback bulk scan calls could therefore reach the remote dispatcher without the same Admin Access requirement legacy applied to SillyTavern bulk scan and run.

What changed

  • Added import_st_bulk_scan to the TypeScript Remote Runtime privileged command set so web-shell calls include the stored Admin Access secret header.
  • Added import_st_bulk_scan to the Rust HTTP runtime privileged command set so /api/invoke rejects off-loopback scan calls unless Admin Access is configured and the x-admin-secret header matches.
  • Added a Rust regression test covering off-loopback scan rejection without ADMIN_SECRET and acceptance with the matching Admin Access header.

Refactor impact

Primary owner:

  • Remote runtime and Rust HTTP/import access control.

Impact areas reviewed:

  • Shared API remote-runtime command routing.
  • Rust HTTP runtime Admin Access guard.
  • SillyTavern bulk import scan/run parity.

Boundary notes:

  • No engine or React feature imports changed. Feature code continues to call the shared import API, which routes through the focused remote runtime wrapper.

Pressure points touched:

  • src/shared/api/remote-runtime.ts privileged remote command set.
  • src-tauri/src/http_server.rs Admin Access command guard and guard-level regression test.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Scratch repro before fix: node scratch/repro-2058-bulk-scan-admin.mjs exited 1 with import_st_bulk_scan remote-allowlisted and Rust-dispatched, but missing from both privileged sets.
  • Scratch repro after fix: node scratch/repro-2058-bulk-scan-admin.mjs passed with import_st_bulk_scan present in both privileged sets.
  • Targeted Rust test: cargo test --manifest-path src-tauri/Cargo.toml remote_st_bulk_scan_requires_admin_access passed.
  • Rust lane check: cargo check --manifest-path src-tauri/Cargo.toml passed.
  • TypeScript lane check: pnpm typecheck passed after pnpm install --frozen-lockfile restored node_modules in the isolated worktree.
  • Full baseline: pnpm check passed.
  • Proof ledger: scratch/bugfix-verification.json.
  • Tooling note: the documented proof-gate helper was unavailable at C:\Users\celia\.codex\tools\marinara-proof-gate.mjs, so that one local helper could not be run.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • This is an internal remote-runtime access-control parity bugfix. It does not add a new user-discoverable feature or workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. This is a Remote Runtime access-control bugfix with command/scratch/Rust test proof rather than visible UI behavior.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2082 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2058-bulk-scan-admin` --- ### 📝 Commits (1) - [`2c15635`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2c156351c5e7efc893fc38f89fb321de394a717b) Protect remote bulk scan with Admin Access ### 📊 Changes **2 files changed** (+32 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/http_server.rs` (+31 -0) 📝 `src/shared/api/remote-runtime.ts` (+1 -0) </details> ### 📄 Description ## Linked issue Closes #2058 ## Why this change - Remote Runtime exposed `import_st_bulk_scan`, but the Admin Access privileged command sets only covered `import_st_bulk_run`. Off-loopback bulk scan calls could therefore reach the remote dispatcher without the same Admin Access requirement legacy applied to SillyTavern bulk scan and run. ## What changed - Added `import_st_bulk_scan` to the TypeScript Remote Runtime privileged command set so web-shell calls include the stored Admin Access secret header. - Added `import_st_bulk_scan` to the Rust HTTP runtime privileged command set so `/api/invoke` rejects off-loopback scan calls unless Admin Access is configured and the `x-admin-secret` header matches. - Added a Rust regression test covering off-loopback scan rejection without `ADMIN_SECRET` and acceptance with the matching Admin Access header. ## Refactor impact Primary owner: - Remote runtime and Rust HTTP/import access control. Impact areas reviewed: - Shared API remote-runtime command routing. - Rust HTTP runtime Admin Access guard. - SillyTavern bulk import scan/run parity. Boundary notes: - No engine or React feature imports changed. Feature code continues to call the shared import API, which routes through the focused remote runtime wrapper. Pressure points touched: - `src/shared/api/remote-runtime.ts` privileged remote command set. - `src-tauri/src/http_server.rs` Admin Access command guard and guard-level regression test. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Scratch repro before fix: `node scratch/repro-2058-bulk-scan-admin.mjs` exited 1 with `import_st_bulk_scan` remote-allowlisted and Rust-dispatched, but missing from both privileged sets. - Scratch repro after fix: `node scratch/repro-2058-bulk-scan-admin.mjs` passed with `import_st_bulk_scan` present in both privileged sets. - Targeted Rust test: `cargo test --manifest-path src-tauri/Cargo.toml remote_st_bulk_scan_requires_admin_access` passed. - Rust lane check: `cargo check --manifest-path src-tauri/Cargo.toml` passed. - TypeScript lane check: `pnpm typecheck` passed after `pnpm install --frozen-lockfile` restored `node_modules` in the isolated worktree. - Full baseline: `pnpm check` passed. - Proof ledger: `scratch/bugfix-verification.json`. - Tooling note: the documented proof-gate helper was unavailable at `C:\Users\celia\.codex\tools\marinara-proof-gate.mjs`, so that one local helper could not be run. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - This is an internal remote-runtime access-control parity bugfix. It does not add a new user-discoverable feature or workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. This is a Remote Runtime access-control bugfix with command/scratch/Rust test proof rather than visible UI behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:11 +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#5424
No description provided.