Skip to content

fix(auth): send WebAuthn assertion data; fetch advanced details authenticated - #874

Open
guimroque wants to merge 2 commits into
mainfrom
fix/webauthn-assertion-and-advanced-details
Open

guimroque wants to merge 2 commits into
mainfrom
fix/webauthn-assertion-and-advanced-details

Conversation

@guimroque

Copy link
Copy Markdown
Member

Why

Companion to infinitybase/bako-safe-api branch guimroque/hake (sign-in hardening after the Nov 2026 account-takeover incident).

  • The API now verifies the WebAuthn assertion itself and needs the raw authenticatorData and clientDataJSON on POST /auth/sign-in. The client already computed both and never sent them.
  • GET /transaction/:id/advanced-details now requires auth and vault membership, so the plain <a href> to the API no longer works. Fetch the JSON through the authenticated api client and open it in a new tab via a blob URL.

Changes

  • core/utils/webauthn/webauthn.ts: signChallange also returns clientData (hex of the raw clientDataJSON)
  • auth/services/methods.ts: signMessageWebAuthn sends authenticatorData + clientDataJSON
  • transactions/services/methods.ts: TransactionService.openAdvancedDetails(id)
  • TransactionCard/Details.tsx, DetailsDialog.tsx: button calls the service instead of linking to the API

Deploy order

API and UI must ship together. Until both are live, WebAuthn login fails (old API rejects the new fields as unknown; new API requires them). Merge the API first, wait for the ECS deploy, then merge this.

Verification

  • tsc --noEmit: no new errors (142 pre-existing in the repo, none in the touched files)
  • eslint clean on the touched files
  • All WEB_AUTHN sign-in paths (including the dApp flow) go through signMessageWebAuthn

🤖 Generated with Claude Code

guimroque and others added 2 commits November 25, 2026 13:08
The API now verifies the WebAuthn assertion itself (challenge bound to the
login code, origin, digest recomputed server-side, signature against the
stored public key). It needs the raw authenticatorData and clientDataJSON,
which the client already computed but never sent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…lient

GET /transaction/:id/advanced-details now requires auth and vault
membership, so a plain <a href> to the API no longer works. Fetch the JSON
with the api client and open it in a new tab via a blob URL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@guimroque

Copy link
Copy Markdown
Member Author

Merge checklist

  • Needs 1 approval (branch protection on main); CI: notify-discord green, e2e-tests red on every PR since Apr 2026 (generic timeouts in all specs) — not caused by this PR.
  • Branch is 0 commits behind main; MERGEABLE.
  • Merge only after infinitybase/bako-safe-api#542 is deployed and its ECS service is stable. Until then the API rejects the new fields; after the API deploy and before this merge, WebAuthn login returns 401 — this PR closes that window.
  • Smoke after the Amplify build: WebAuthn login at https://safe.bako.global, then "Advanced details" on a transaction opens a new tab with the JSON.
  • Rollback: revert the merge commit.

This branch has not been deployed

No deployments
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