Repository navigation
fix(security): authenticate local wallet HTTP API across localhost, webview, desktop, and Android - #252
Open
NubsCarson wants to merge 1 commit into
Open
fix(security): authenticate local wallet HTTP API across localhost, webview, desktop, and Android#252NubsCarson wants to merge 1 commit into
NubsCarson wants to merge 1 commit into
Conversation
…ebview, desktop, and Android Require a per-launch 256-bit bearer capability on localhost /session, /events, and /rpc endpoints, delivered via an owner-only launch URL file under $AGENTNET_HOME/localhost-auth/<port>.url instead of unauthenticated HTTP endpoints or cookies. - Bind surfaces/localhost to 127.0.0.1 and enforce Host, Origin, Sec-Fetch-Site, no-store, and constant-time Bearer checks in httpAuth. - Update surfaces/webview Transport to capture the launch fragment into origin-scoped sessionStorage, strip it from history, authenticate fetch-based SSE and RPC requests, and fail closed to a localAuth lock state that clears revealed secrets on missing or rejected sessions. - Update Vite dev proxy to forward authenticated /session, /events, and /rpc requests while blocking cross-origin requests. - Update Desktop (Tauri) and Android wrappers (plus Android notification RPC actions) to read the private launch file and verify GET /session before opening the UI. - Add localhost HTTP and transport security regression tests, webview reducer lock-state tests, and surfaces/localhost/README.md.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Require a per-launch 256-bit bearer capability on local wallet HTTP endpoints (
/session,/events, and/rpc), delivered via an owner-only launch URL file ($AGENTNET_HOME/localhost-auth/<port>.url) instead of unauthenticated localhost HTTP endpoints or cookies.Changes
surfaces/localhost): Bind to127.0.0.1, enforceHost,Origin,Sec-Fetch-Site,Cache-Control: no-store, and constant-time Bearer checks insrc/httpAuth.ts, and document the launch flow insurfaces/localhost/README.md.surfaces/webview): Capture the launch fragment into origin-scopedsessionStorage, strip it from browser history, authenticate fetch-based SSE and RPC requests, fail closed to alocalAuthlock state that clears revealed secrets on missing or rejected sessions, and updatevite.config.tsto forward authenticated/session,/events, and/rpcrequests while blocking cross-origin requests.surfaces/desktop): Read the private launch file insrc-tauri/src/local_session.rsand verifyGET /sessionbefore opening the UI.surfaces/android): UpdateMainActivity,ServerManager,RpcClient, andNotifActionReceiverto read the private launch file and authenticateGET /sessionand notification RPC actions.surfaces/localhost/test/http-security.test.ts) and webview reducer lock-state tests (surfaces/webview/src/state/store.spec.tsx).Verification
.github/workflows/ci.yml(test-and-build): PASS (agent-sdk581 passed / 5 skipped,webview26/26 passed + build, alltsc --noEmit, CLI and MCP builds)pnpm --filter agentnet-localhost test: 5/5 PASS + live localhost server E2E smoke test PASScargo testPASScompileDebugKotlinPASS