fix(claim): reuse sealed at-rest token after a check-in nulls its hash#125
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A Door A (password-vault) heir was permanently locked out of any claim once the owner had checked in at least once before lapsing. Root cause: the check-in handler nulls `claim_token_hash` (so a fresh alarm can start clean) but never clears `claim_token_at_rest_b64`. The trigger's reuse logic keyed on BOTH fields being present, so a checked-in password vault fell through to minting a brand-new token. The heir's xprv is sealed under the ORIGINAL token via HKDF, so the fresh token can never unseal it. The new token is also base64url, which crashed the claim page with a cryptic `atob` error before the heir even got that far. Owners check in constantly by design (it's a dead-man's switch), so in practice this hit almost every real Door A inheritance. Pre-existing (predates the non-custodial track); surfaced by the signet e2e. Fix: - scheduler: decide reuse on the sealed at-rest token alone. Decrypt it, reuse that exact token, and re-derive + write back the hash when a check-in had cleared it. Legacy vaults (no at-rest token) still mint. - sealing: make b64decode tolerant of base64url so a valid token can never crash the claim with atob again. Tests: - scheduler: password_vault_reuses_at_rest_token_after_checkin_cleared_hash - web: sealing.test.ts (base64 / base64url round-trips) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Jolah1
force-pushed
the
fix/door-a-heir-lockout-token-reuse
branch
from
June 19, 2026 11:09
b83ef28 to
5e8ba72
Compare
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.
Critical: Door A heirs were locked out of claims
A Door A (password-vault) heir was permanently locked out of any claim once the owner had checked in at least once before lapsing. Owners check in constantly by design (it's a dead-man's switch), so in practice this hit almost every real Door A inheritance.
This is pre-existing (predates the non-custodial track / #124) and is live on mainnet. The signet e2e surfaced it.
Root cause
claim_token_hash(so a fresh alarm starts clean) but never clearsclaim_token_at_rest_b64.atoberror before the heir even got that far.Fix
b64decodetolerant of base64url so a valid token can never crash the claim withatobagain.Tests
cargo test -p ghostkey-server— 137 passed (+1:password_vault_reuses_at_rest_token_after_checkin_cleared_hash, reproduces check-in → lapse → claim)vitest—sealing.test.ts, base64 / base64url round-tripsNotes
🤖 Generated with Claude Code