docs(supabase): V1-2.5 checkpoint decisions, TOTP reuse measured, lost-factor review

IDENTITY 4.1 asserted reuse span (step N and N+1), 4.2 lost authenticator paths and gaps, production prerequisite; V1-2 contract 12.3, 13, 17.10, 17.11; design README accepted deviations; REVUE L15 and object_conflict EN; M7 header.
This commit is contained in:
bchanot committed 2026-11-02 22:57:22 +01:00
1 parent 0499a39389
commit dcb1a94ee4
9 files changed
+161 -16

No files matched your search

+36 -3
View File
@@ -121,7 +121,7 @@ right (`V1-2_ANATOMICAL_SHEETS.md` §5.6, §5.7). State since V1-2.5:
(§4.1).
Still open: the recovery runbook for a lost factor (V1-2 contract §5.7.7) is
rehearsed at V1-2.9.
rehearsed at V1-2.9; the paths and gaps are reviewed in §4.2.
### 4.1 GoTrue v2.197.0 behaviour, measured on the sandbox (V1-2.5)
@@ -156,8 +156,41 @@ rehearsed at V1-2.9.
- Refresh keeps `aal2`; a new password sign-in starts at `aal1`.
- Email change: refused at `aal1`; from `aal2` the confirmation link opens a
new `aal1` session. Identity linking: 404 `manual_linking_disabled`.
- A TOTP code accepted twice within its 30 s window by two sessions of one
factor (observed, not asserted).
- TOTP code reuse (case 11, asserted): GoTrue keeps no record of used codes.
A code C taken in a fresh 30 s step N is accepted by session A, then by a
second `aal1` session B signed in after A's verify (B proven alive first,
and it reaches `aal2`), then by A again. A session D verifying C in step
N+1 is accepted too (one step of skew); a session E verifying C in step N+2
is refused (422 `mfa_verification_failed`). Measured span of one code: its
own step and the next, 30 to 60 s. Consequence: a code seen over a shoulder
or relayed by a phishing page can be replayed once by another password-holding
session within that span; it does not outlive it. Configuration that ran
the measurement: the sandbox GoTrue (`scripts/db-sandbox.sh`, image
`gotrue:v2.197.0`), which sets no MFA variable, so the image defaults apply.
The CLI and DEV stacks are configured by `supabase/config.toml` `[auth.mfa]`
(`max_enrolled_factors = 10`) and `[auth.mfa.totp]` (enrolment and
verification on), no replay setting either; the same behaviour is expected
there but only the sandbox was measured. No mitigation is added: the span is
a residual risk (V1-2 contract §13).
### 4.2 Lost authenticator: paths and gaps
Review of what happens when a person loses the device holding their TOTP
factor (V1-2 contract §5.6, §5.7.7). It describes; it adds no path and does
not weaken `aal2`.
| Path | What exists | Gap |
|---|---|---|
| Second factor | A factor is enrolled from `aal2`, then any verified factor reaches `aal2`. Recommended for every capability holder, two factors on two independent devices for the owner (§5.6, §5.7.7). | Nothing forces a second factor on a capability holder; a person with one factor and a lost device has no second path. |
| Self-service recovery | None. GoTrue issues no recovery codes. Password change and reset, and removal of a verified factor, need `aal2` (case 7, 4), so a lost factor cannot be removed or bypassed by the person. An ordinary account keeps its `aal1` use of the application; a capability holder loses the administration until recovery. | No recovery code or backup channel. By design. |
| Authorised administrative intervention | Operator procedure of V1-2 §5.6 and §5.7.7, run with server access: sign out every session, delete the factors, ban, new password with the person present, lift the ban, two new factors, list the factors. Never an application path: no RPC, screen or service path resets a factor. | A procedure on paper: not rehearsed (V1-2.9). |
| Identity checks | Out of band, the owner present, the reason recorded before anything changes. | Human control only; nothing in the system verifies it. |
| Audit trail | The operator writes the `auth.mfa_factor_reset` row in the same session; GoTrue keeps its own audit log of the factor and session changes. | The row depends on the operator writing it; a forgotten row is not detected. On a single-owner platform the operator is the owner, so there is no second person to check (the real control is server access). |
Production prerequisite: a recovery runbook rehearsed on the sandbox and
written here before any production use of MFA-protected rights. Until it
exists, the safe lost-factor recovery is missing, and capabilities must not
be granted in production.
## 5. Manual validation (local stack)