Skip to content

Remote-access security hardening: audit + lock down the any-device→tunnel→shell path #396

@dotdevdotdev

Description

@dotdevdotdev

Umbrella: portal-boundary hardening

Re-scoped 2026-06-18 after the security audit (audit comment) + the #420 networking review. Original framing ("wide-open, unaudited any-device→tunnel→shell") was stale on two counts:

  1. The core ask already shipped (PR feat(portal): security hardening — origin checks + token auth (close the no-auth gap behind the bind default) #247/feat(portal): security hardening — origin checks + token auth (#247) #248): server.host defaults to 127.0.0.1, bearer-token auth, refuse-to-start-without-token on non-loopback, constant-time compare, MCP is stdio-only (never network-exposed).
  2. agentwire owns no internet tunnel (Networking/tunnel footprint review: what does agentwire own, and should it? #420): the "from anywhere" path is the user's own cloudflared/tailscale. agentwire's responsibility ends at "the portal refuses unauthenticated requests regardless of what's in front of it." This issue hardens only the portal listener — not tunnels, not remote-machine SSH.

Residual gaps → follow-up issues

Created (high-risk — leaked-token blast radius):

Backlog (pull when ready):

  • Auth-failure audit log + per-IP lockout + optional owner email on a burst (reuse Resend)
  • TLS-or-loopback enforcement (refuse non-loopback plaintext bind without explicit --insecure)
  • Reduce unauthenticated fingerprint (/health, /, /mobile confirm agentwire pre-token) — low priority
  • Verify/fix artifact path-traversal on DELETE /api/artifacts/{filename:.+} + upload write target

Retracted: "retire the remote SSH terminal branch" — that's cross-machine session viewing, KEEP (see #420).

Verification (baseline, already satisfiable)

From a second device without the token, every non-public route returns 401; with the token, full access works. #423/#424 are what make "full access" scoped instead of all-or-nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions