Assisted recovery (#305) confirms with a passkey or a connected CoinPay
identity, but an account that signed up by email had no way to get either:
the passkey button exists only on the sign-in page, and Sign in with CoinPay
only ever created a new account.
- Settings > Vault email recovery shows what the account has and an "Add a
passkey" button (the existing register endpoints, which already attach to
the signed-in user).
- "Connect CoinPay" (shown when CoinPay sign-in is configured) binds the
CoinPay subject to the signed-in account. An identity that already belongs
to another account is refused; an account keeps its first identity.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Email recovery needs the recovery code from the enrollment email. People who
delete their mail lose it, and with it the only way back in.
`logicsrc vault recovery enable --assisted` (opt-in) replaces that code with a
fresh sign-in: recovery asks for the one-time code emailed at that moment and a
confirmation in the browser with a passkey of the account or its connected
CoinPay identity (bound by subject, never by email, never creating an account,
no session made).
- Server: U is kept sealed under VAULT_ESCROW_KEY in vault_recovery_assisted
(migration 015) only for accounts that ask. A step-up
(vault_recovery_stepups) is single use, lives ten minutes, names no account
and is approved only by a proof belonging to the account being recovered.
The second proof is checked before the one-time code, so a missing
confirmation never spends it. A claim without a confirmed step-up never
returns U. disable and a plain re-enroll delete the stored U.
- CLI: `passwd --email` and `vault recover --email` print the link, wait for
the confirmation, then ask for the one-time code. The re-arm keeps the mode.
- This mode is custodial: the server holds everything that opens the vault.
docs/opencreds/security.md says so; accounts that do not opt in keep the
split-key scheme unchanged.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Email recovery reset the vault only. The SSH keyring kept its old passphrase,
so someone who had forgotten everything recovered the vault and was then
refused by `keyring restore` ("Wrong keyring passphrase").
- `logicsrc passwd --email`: opens the vault with the two emailed codes, then
puts the vault and the keyring under one new password. New vault recovery
key, email recovery re-armed, same end state as `vault recover --email`.
- Every `passwd` run stores the keyring's user key as an item in the vault
(found by a stable id, verified against a keyring entry before use), so the
vault's way back in is the keyring's too and nobody is asked a second secret.
- A keyring nothing opens is set aside (kept as keyring.bak-NNN) and started
fresh; keys whose files are still under ~/.ssh with the same fingerprint are
put back, the rest are named.
- The re-arm email after a recovery had the first-time wording ("run
logicsrc vault recover --email"), which read as an instruction to recover
again: three recoveries in five minutes on one account. It now says the
recovery is complete and there is nothing to do. The CLI says so too.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* vault: opt-in paid email recovery for the personal vault ($5 lifetime)
A second way back into a logicsrc personal vault when the master password and
the offline recovery key are both gone, without the server holding anything
that alone (even with the DB and server env) opens the vault.
Client (packages/opencreds): random escrow key E encrypts the user key K
(AES-256-GCM, AAD "<ns>:vault:email-escrow:v1|<createdAt>"); E is split into
S (random, to the server) and U = E XOR S (emailed once as a checksummed
Crockford recovery code, never stored). `recover --email` checks the code's
check group first, asks the server for a one-time code, claims S, recombines
E, proves K against an item, sets a new password, issues a new offline
recovery key and re-enrolls with fresh shares (warns loudly if that fails).
New `recovery status|buy|enable|disable` commands; the CLI client lives in
packages/cli/src/vault-sync.ts.
Server (apps/pwa): /api/opencreds/recovery/{checkout,enroll,start,claim} +
status/disable. S is sealed under VAULT_ESCROW_KEY (versioned for rotation,
AAD binds the user). Enrollment is pending until the email with U is sent,
else rolled back. One-time codes: 8 digits, HMAC at rest, 15 min, 5 tries,
single use, 3 starts/hour; claims are audited and announced by email.
Purchase via CoinPay checkout (purpose vault_recovery); /api/coinpay/webhook
now verifies once and dispatches by purpose, auto_rotation unchanged.
Settings card with status and a Buy button. Migration 014 in both dialects.
Docs: security.md and crypto.md "Email recovery (opt-in, paid)" sections with
the honest trade-off; cli.md command reference.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* vault email recovery: state that the mailbox alone is enough
The account password resets by email, so mailbox control = sign-in + one-time
code + the enrollment code U. Say so in security.md and stop the one-time-code
email from implying the vault stays safe if someone else reads the mailbox.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* vault email recovery: leave .env.example as on master
Touching it made the credential gate re-scan the existing SESSION_SECRET
placeholder (false positive). VAULT_ESCROW_KEY / _VERSION / VAULT_RECOVERY_PRICE_USD
are documented in docs/opencreds/security.md and crypto.md; prod values live in
vault app-logicsrc-com--prod.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>