security: the bridge SSO session cookie is the bare AID, unsigned — anyone who knows a member's public AID can take the silent hop as them #1966
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1966
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 fault
The bridge's sign-in session cookie carries the member's AID as its value, unsigned:
and the silent cross-client SSO hop reads it straight back (
completeFromSession):heldCredential(c.Value)— is that AID inheldand unexpired (12 h)?verifierFor(identity).IsIssued(...)— does its membership credential still stand on the community's ledger?authRequestForLogin(id)— is there a live auth request?completeLogin(id, identity)→ the auth request is now authenticated as that AID.Every one of those checks passes for an attacker who simply asserts someone else's AID. No step involves a secret.
An AID is a public identifier. It is on the community ledger, in every credential, on the Members roster, in the sign-in QR, and in the
puaid=parameter the panel's own transport reads today. Knowing one is not a compromise — it is the normal state of affairs.HttpOnly,SecureandSameSite=Laxdo not help here. They stop a script reading the cookie and stop a cross-site request carrying it; they do nothing against an attacker who sets the cookie in their own client.What it costs
Within the 12 h after any member last signed in, anyone who knows their AID can:
Cookie: idss_idp_session=<their AID>;For an ordinary member that is their files and their chat. For a steward it is the control panel. It needs no phone, no words, no credential and no network position — only a public string and a live
heldentry.The control panel's own session gets this right (
internal/controlapi/session.go): a stateless HMAC-signed cookie over{identity, expiry}, withhmac.Equalon every read, because "it is the one place the session's trust is." The bridge, one hop upstream, has no equivalent.What to build
The cookie must carry something unforgeable. Two honest shapes, and a recommendation:
heldis already a server-side map; key it by a random id minted atcompleteLoginrather than by the AID, and let the cookie carry only that id. The AID is then never an input, and the bridge gains real per-session revocation for free — which is what#1935's panel-session epoch had to invent separately, and what sign-out (#1713, #1363) has never truly had.controlapi/session.goalready ships. Smaller diff, one more place a secret must be provisioned and rotated, and it still cannot revoke a single session before its expiry.Either way: the AID alone must never again be sufficient, and an unrecognised or unverifiable cookie must fall through to the sign-in form exactly as today (fail closed, no error page).
Acceptance criteria
idss_idp_sessionset to that member's AID, then the silent hop is REFUSED and the sign-in form is rendered.internal/idp's existing seam, with a forged-cookie case that is red before the fix.Blocked by
Notes
Close-report — #1966 (Ruled by agent under ADR 0174 — two-way, veto anytime)
What landed (
main@2669b857): the bridgeidss_idp_sessioncookie no longer carries the bare AID. Both doors now mint a 256-bit opaque session id (store.sessions: id → AID, 12 h, live-session state cleared on restart,internal/idp/storage.go) and the cookie carries only the id.completeFromSessionresolves the id server-side (sessionAID) before the existing held-cache lookup and ADR 0196 ledger re-walk; an unknown/tampered/truncated/expired id fails closed to the sign-in form. Sign-out destroys the id (endSessionByCookie+ a per-AID sweep inendSession,signout.go), so a captured cookie value cannot be replayed once its owner signs out.Acceptance criteria
TestSeam_ForgedAIDCookie_RefusedToSignIn(RED before the fix, green after).TestSeam_SilentSSO_AcrossClientsunchanged & green.TestSeam_TamperedSessionCookie_FailsClosedToSignIn.TestSeam_SilentHopAfterRevoke_FallsToSignIngreen.TestSeam_SignOut_OldSessionCookieCannotBeReplayed+TestSeam_IDIPSignOut_ValidRedirect_EndsBridgeSession.TestSeam_AppDoorSession_IsOpaqueAndCompletesSilentHop.internal/idp's existing seam with a forged-cookie case red before the fix.Proof: full
go test ./internal/idp/green;go build ./...,go vet,gofmt -l,golangci-lint run ./internal/idp/(0 issues) all clean. New seam fileinternal/idp/signin_session_cookie_seam_test.go;keri_verifier_test.go's oldcookie == AIDassertion updated to the opaque shape.Docs: ADR 0196 amended (
Amendment 2026-09-28 — the session cookie carries an OPAQUE id, not the AID); STATUS.md milestone log updated in the same commit.Scope / not done here: per-service admin state and #1961's minted handover capability are their own tickets and untouched; the
heldmap stays AID-keyed for the device-code/refresh paths (op supplies the subject there — no cookie, not forgeable), so only the cookie's key changed.