Skip to content

fix(step-up): answer a relying party's step-up as the identity that signed in - #458

Merged
stormer78 merged 1 commit into
mainfrom
fix/step-up-signs-as-site-persona
Nov 26, 2026
Merged

stormer78 merged 1 commit into
mainfrom
fix/step-up-signs-as-site-persona

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Follow-up to #456. With the control plane now accepted as the step-up's executor, a holder signed in to the did-hosting console as a per-site persona was refused at the next check:

step-up approve-request refused: it is addressed to did:webvh:…:glenn-vta, not this wallet

Why

The persona is the session's subject: auth/authenticate was signed as it, through the VTA. The control plane addresses the approve-request to the subject and accepts a decision only from it (approve_response: approver != pending.subject → approverUnauthorized). The wallet always answered with its own did:key, so a persona session could never be stepped up.

Change

  • Background: handleApproveSessionStepUp decides the identity the way sign-in does: stepUpIdentity → decideSiteIdentity. It never raises the picker, and the page can't name the entry. It passes the vault entryId (plus restBaseUrl) to the offscreen.
  • Offscreen: doApproveSessionStepUp signs as that persona through the VTA (personaTaskSigner). With no persona, the holder key answers, unchanged.
  • VTA purpose: vault/sign-trust-task signs auth/step-up/approve-response/0.7 for assertionMethod (vta-sdk purpose_for_document_type, ATTESTATION_SLUGS; covered by vta-service vault_sign_trust_task_purpose.rs).
  • Core: buildStepUpApproval / performRpStepUp / verifyRpStepUpRequest take a ChannelSigner (a local key or a TaskSigner) instead of a bare SigningIdentity. The signature now goes through asTaskSigner(...).sign(doc, { proofPurpose: "assertionMethod" }).
  • Docs: CLAUDE.md records the rule and what would break it.

Verified

  • Against a live control plane (webvh.storm.ws, persona glenn-vta): the control plane logged step-up approved: session elevated to aal2. The session renewal that follows failed for an unrelated control-plane reason, fixed separately in affinidi-webvh-service.
  • Tests: core tests/rp-login.step-up.mjs adds two: a persona session is answered by the persona, signed for assertionMethod; the holder key can't answer a persona's step-up. Core 1350 pass and extension 1612 pass.
  • Build: npm run build succeeds, and the CI bundle guards pass locally.

Pre-merge checklist (vti-stack-development-guide §9)

  • No new reqwest::Client::new() / bare fetch(); all clients have finite timeouts (R1.2): the persona signs through the existing VTA session (getVtaSession)
  • No lock held across a network await (R1.3)
  • No local state committed before its remote effect, or the flow is resumable with an idempotency key (R2.1): nothing written
  • Every retry is bounded + backed off; non-idempotent ops are not blind-retried (R1.4): no retries added
  • Accept/poll/listen loops survive transient errors (R1.5): n/a
  • Acks/deletes happen only after durable handoff (R1.6): n/a
  • New/changed wire types: camelCase, deny_unknown_fields where security-relevant, schema registered, all consumers (incl. JS) updated (R3.*): internal background→offscreen message only (entryId, restBaseUrl, optional, background-set)
  • Config absence = most restrictive; fail-closed if enforcement can't start (R5.*): a vault lookup failure refuses the step-up
  • Logs/status claim only what was verified; background-job failures are surfaced (R6.*)
  • "Process dies on the next line" answered for every mutation touched (R2.1): no mutations
  • Deviations from this guide flagged explicitly with rule numbers: none

…igned in

A site signed in to as a per-site persona has that persona as the session's
subject. The did-hosting control plane addresses its step-up approve-request
to the subject and accepts an answer only from it, but the wallet always
answered with its own holder key, so a persona session's step-up was refused
before any prompt ("step-up approve-request refused: it is addressed to
<persona DID>, not this wallet").

handleApproveSessionStepUp now decides the identity the way sign-in does
(stepUpIdentity -> decideSiteIdentity, never the picker) and passes the vault
entry to the offscreen, which signs the approve-response as that persona
through the VTA (personaTaskSigner; vault/sign-trust-task signs this type for
assertionMethod). Without a persona the wallet's own key answers, as before.
In core, buildStepUpApproval and performRpStepUp take a ChannelSigner (a
local key or a TaskSigner) instead of a bare SigningIdentity.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 120cd99 into main Nov 26, 2026
4 checks passed
@stormer78
stormer78 deleted the fix/step-up-signs-as-site-persona branch November 26, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant