Repository navigation
fix(dashboard): authenticate by request header, not a shared cookie - #4301
Merged
Merged
Conversation
|
Comment on lines
+105
to
+106
| let path = uri.path(); | ||
| matches!(*method, Method::GET | Method::HEAD) && path != "/api" && !path.starts_with("/api/") |
Contributor
There was a problem hiding this comment.
🟥 Non-API routes bypass dashboard authentication
When a listener mounts a GET route outside /api, is_page_shell admits it without a token. The previous admission check protected every non-launch route, so callers can read data exposed there anonymously.
Was this helpful? React with 👍 or 👎 to provide feedback.
ScriptedAlchemy
enabled auto-merge
October 18, 2026 12:25
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.
Fixes #4203
Broken. The dashboard traded its launch token for a
Path=/cookie. Browsers scope cookies by host, not port, so the cookie was replayed to any other service on the same loopback host.Fix. The dashboard never sets a cookie now. Credential flow: launch URL
/?token=T->303 /path#token=T(no-store,no-referrer; a fragment never goes on the wire) -> the page moves the token into origin-scopedsessionStorage(the origin includes the port, so concurrent dashboards stay separate), clears the fragment withreplaceState, and sendsAuthorization: Basicon every same-origin request. The event stream is a fetch-basedEventSourcereplacement (dashboard/src/data/auth/) that sends the header and resumes withLast-Event-ID. Host, Origin, token and Basic checks are unchanged. The embedded page shell (/,/static/**, client routes) carries no secret and is now served without the token, since a navigation cannot carry a header. Every/apiroute still needs it.docs/dashboard.mdis updated.Test choice. A browser fixture would need a browser plus the full binary and bundle, so the regression test is a Rust test with a real second TCP listener and a browser model (host-scoped cookie jar, origin-scoped page storage):
authority_tests/credential_isolation.rs. Dashboard-side behavior has vitest coverage.Evidence.
Set-Cookieto the launch redirect failsan_unrelated_loopback_listener_receives_no_replayable_credential("the other listener saw the dashboard token: Cookie: tracedecay_dashboard_1=...") andloopback_requests_need_the_listener_access_token.document.cookiewas empty, and a snoop listener on another loopback port saw noCookieorAuthorizationheader after the browser visited it.//crates/tracedecay-dashboard-api:unit_test,//crates/tracedecay:dashboard_api_test, the two updated mcp_suite tests, clippy and rustfmt for touched crates, dashboard typecheck, full vitest (2106),contracts:check.