mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-04 02:29:06 +00:00
feat(recovery): assisted recovery, no old email: one-time code + passkey or CoinPay (CLI 0.18.0) (#305)
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>
This commit is contained in:
parent
896eba3c07
commit
6ff3089088
16 changed files with 799 additions and 62 deletions
|
|
@ -163,6 +163,37 @@ What this does and does not hold against, stated plainly:
|
|||
Turning it off (`logicsrc vault recovery disable`, or Settings) deletes the
|
||||
escrowed blob and S on the server, after which the emailed code is useless.
|
||||
|
||||
### Assisted recovery (opt-in on top of email recovery)
|
||||
|
||||
`logicsrc vault recovery enable --assisted` is for people who do not keep old
|
||||
email. Recovery then asks for two things and no stored code: the one-time code
|
||||
emailed at that moment, and a fresh sign-in in the browser with a passkey of
|
||||
the account or its connected CoinPay identity (bound by the CoinPay subject,
|
||||
never by email).
|
||||
|
||||
**This mode is custodial, and that is the whole trade.** To make it work the
|
||||
server keeps the user share U as well as S, each sealed under
|
||||
`VAULT_ESCROW_KEY`. With both it can rebuild the escrow key and open the
|
||||
vault. So for an account that turns this on:
|
||||
|
||||
- the server operator, or anyone who takes the database **and** the escrow
|
||||
key, can read the vault;
|
||||
- "the server cannot read the vault" no longer holds for that account.
|
||||
|
||||
It still holds for every account that did not opt in: there is no row for them
|
||||
in `vault_recovery_assisted`, U is mailed once and never stored, and a claim
|
||||
without a confirmed step-up never returns U.
|
||||
|
||||
What an outside attacker needs against an assisted account: the account's API
|
||||
token or session, the mailbox (for the one-time code), **and** the passkey or
|
||||
the CoinPay account. The confirmation link is single use, lives ten minutes,
|
||||
names no account, and is approved only by a proof that belongs to the account
|
||||
being recovered. The second proof is checked before the one-time code, so a
|
||||
missing confirmation never spends the code.
|
||||
|
||||
Running `logicsrc vault recovery enable` without the flag goes back to the
|
||||
split-key scheme and deletes the stored U; so does `recovery disable`.
|
||||
|
||||
## Reporting
|
||||
|
||||
Security issues in the specification or the reference implementation:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue