Skip to content

fix(server): plugin host routes require an authenticated admin session - #33

Merged
MiaAI-Lab merged 1 commit into
mainfrom
fix/m3-plugin-route-auth
Nov 26, 2026
Merged

MiaAI-Lab merged 1 commit into
mainfrom
fix/m3-plugin-route-auth

Conversation

@MiaAI-Lab

Copy link
Copy Markdown
Owner

/api/m3-plugins/* had no authentication. POST /api/m3-plugins/install clones a git URL and starts the plugin's sidecar, so anyone who could reach the server port (LAN, tailnet or tunnel) could run code on the host. Found while reviewing #29, which would have added a default-on plugin with a docker run endpoint behind the same routes.

Every plugin route now authenticates through authenticateMediaRequest, the same cookie-or-ticket check the device hub and preview tunnel use, and requires environment:maintain. The web plugin host fetches same-origin, so local browser and desktop sessions keep working.

m3PluginRoute.test.ts covers 401 without credentials, 403 without the scope, and 200 with it. The first two fail on main.

vp run check:changed: format, lint, knip, graphql and tests pass. Typecheck reports the same 4 errors main already has, all in files this PR doesn't touch (IssueService.test.ts, ProviderSessionManager.ts, antigravityUsageLimits*.ts).

Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

/api/m3-plugins/* had no authentication. POST /install clones a git URL
and starts its sidecar process, so anyone who could reach the server port
(LAN, tailnet or tunnel) could run code on the host. Every plugin route
now authenticates like the other media routes and requires
environment:maintain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS labels Nov 26, 2026
@MiaAI-Lab
MiaAI-Lab merged commit 467f95c into main Nov 26, 2026
13 of 24 checks passed
@MiaAI-Lab
MiaAI-Lab deleted the fix/m3-plugin-route-auth branch November 26, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant