[relay] Join page: GET /join hands an invite link opened in a browser to the app #19
Reference in New Issue
Block a user
Delete Branch "feature/join-page"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The join page:
GET /join, for Amicitia's seamless invites (Amicitia.agents/features/seamless-invite.md). Analysis:.agents/features/join-page.md. Protocol: §8 lists the route and what the relay learns.https://<relay>/join#<invite id>.<secret>, which messengers make tappable (they do not makeamicitia://tappable).GET /join; the fragment, and so the secret, never reaches the relay, a link preview or a proxy.Content-Security-Policyofdefault-src 'none'(computed from the page at start-up),no-store,no-referrer,nosniff, no cookie, framing refused. Its one button opensamicitia://invite?relay=<its origin>#<id>.<secret>, after a tap.sha20.10 andbase640.22, both already in the workspace (the protocol crate's).Adversarial self-review — the join page
Evidence
cargo test --workspacewire14; relayquotas8,relay19 (2 new)-D warnings,cargo fmt --checkmutate_join.py)'unsafe-inline'for scripts; the page cached; the referrer sent; framing allowed; a web font from elsewhere; the fragment sent to the server withfetch; an automatic redirect; a policy hash not of the scriptamicitia://invite?relay=https://relay.example.cz#AAAA….BBBB…; empty, too short and tampered fragments hide the button and say the link is incompleteFindings
J1–J4 are on their lines.
Not verified
adb reverse, Chrome, the app opening).Verdict
Merging.
@@ -0,0 +38,4 @@document.getElementById("bad").hidden = false;return;}open.href = "amicitia://invite?relay=" + location.origin + "#" + invite;J2 — privacy. The secret is only ever in the fragment and goes only into the button's target, which the person taps. The test refuses
fetch, XHR, beacons, sockets and every way of leaving the page by script. No automatic redirect: Chrome blocks a custom scheme without a gesture, and a page that sometimes jumps is worse than one button.@@ -38,6 +38,7 @@ pub fn router(state: AppState) -> Router {.route("/v0/invites", post(create_invite)).route("/v0/invites/{id}", get(claim_invite)).route("/version", get(version)).route("/join", get(crate::join::page))J4 — scope. The page names Amicitia, the app this relay serves; the relay itself is still your message relay to users. A relay run for another app would need its own page — not a concern while Amicitia is the only client.
@@ -0,0 +33,4 @@/// font, no connection, no frame, no form.pub static CONTENT_SECURITY_POLICY: LazyLock<String> = LazyLock::new(|| {format!("default-src 'none'; script-src {}; style-src {}; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",J1 — the page as attack surface.
default-src 'none'with the script and style by hash: no other script can run, nothing loads, no connection is possible (connect-srcfalls back to'none'), no form, no framing. The hashes are computed from the page itself, so an edit cannot ship without them. Planted bugs on each part caught.@@ -115,1 +116,4 @@come from §5's own rows and `size`. A client treats 507 like any failure and tries again later.- **The join page** *(added 2026-11-18; `.agents/features/join-page.md`)*: an invite can travel as`https://<relay>/join#<invite id>.<secret>`, which messengers make tappable. The browser sendsonly `GET /join`: the fragment, and so the secret, never reaches the relay, a link preview or aJ3 — what the relay learns. That some address opened
/join— no more than any client of it tells it; it stores and prints nothing for the page. A messenger's link preview fetches/jointoo, without the fragment. Said here, in §8.Merged into main as
f075fae(--no-ff), verified on the remote. Review: this PR.Pull request closed