feat(keys): H-4 trustee-only migration — the server share ceases to exist (#136 slice 2) #138

Merged
amiryahaya merged 1 commit from feat/136-trustee-only into main 2026-11-10 03:46:56 +01:00
Owner

#136 slice 2 — the H-4 remediation: the server-held share contradicted the trustee-only 2-of-3 design AND was a live liability. GET /api/recovery/share was a PUBLIC, DID-keyed endpoint handing the server share to anyone holding the DID — with one phished trustee share that made 2-of-3.

Removed:

  • server_share from the /setup contract and the RecoverySetup schema (migration drops the column) — the server now holds ONLY the epoch KeyProof, which gates completion but is not a share
  • the /api/recovery/share endpoint entirely (file, SEC-04 PublicRouteRegistry entry, AuthzMatrix row)
  • the ServerShare wipes in CompleteRecovery/DeleteRecoverySetup

Unchanged: recovery completion keeps both gates — KeyProof match (fixed-time compare) + an APPROVED trustee request in the current epoch (#86). 2-of-3 trustee approval is the only path to recovery.

Tests: TrusteeOnlyMigrationTests (new): setup without server_share succeeds; share endpoint answers 401/404 — never a share; completion gates still enforced. RecoveryShamirTests reworked to the trustee-only contract; RecoveryProbeEvidenceTests retired (endpoint gone). All recovery suites green.

Suite 977/0/39 (Release+Debug), coverage gate 87.70%. Slice 2 of #136; remaining: KEY-13 wrap-fetch limiter check, KEY-19 entropy pin, golden vectors.

**#136 slice 2** — the H-4 remediation: the server-held share contradicted the trustee-only 2-of-3 design AND was a live liability. `GET /api/recovery/share` was a PUBLIC, DID-keyed endpoint handing the server share to anyone holding the DID — with one phished trustee share that made 2-of-3. **Removed:** - `server_share` from the /setup contract and the RecoverySetup schema (migration drops the column) — the server now holds ONLY the epoch KeyProof, which gates completion but is not a share - the **/api/recovery/share endpoint** entirely (file, SEC-04 PublicRouteRegistry entry, AuthzMatrix row) - the ServerShare wipes in CompleteRecovery/DeleteRecoverySetup **Unchanged:** recovery completion keeps both gates — KeyProof match (fixed-time compare) + an APPROVED trustee request in the current epoch (#86). 2-of-3 trustee approval is the only path to recovery. **Tests:** TrusteeOnlyMigrationTests (new): setup without server_share succeeds; share endpoint answers 401/404 — never a share; completion gates still enforced. RecoveryShamirTests reworked to the trustee-only contract; RecoveryProbeEvidenceTests retired (endpoint gone). All recovery suites green. Suite 977/0/39 (Release+Debug), coverage gate 87.70%. Slice 2 of #136; remaining: KEY-13 wrap-fetch limiter check, KEY-19 entropy pin, golden vectors.
feat(keys): H-4 trustee-only migration — the server share ceases to exist (#136 slice 2)
All checks were successful
API CI / build-and-test (pull_request) Successful in 3m46s
Security CI / security-scan (pull_request) Successful in 2m40s
cf688e3c04
The legacy server-held share contradicted the trustee-only 2-of-3 design
AND was a live liability: GET /api/recovery/share (public, DID-keyed)
handed the server share to anyone holding the DID — with one phished
trustee share that made 2-of-3.

- SetupRecovery: KeyProof-only contract (server_share dropped from the
  payload + storage; the epoch KeyProof gate is untouched)
- RecoverySetup.ServerShare column dropped (migration)
- GET /api/recovery/share endpoint REMOVED (file, SEC-04 registry,
  AuthzMatrix row) — it never answers anything now
- CompleteRecovery/DeleteRecoverySetup: ServerShare wipes dropped
- RecoveryShamirTests reworked to the trustee-only contract (share
  endpoint now asserted REMOVED; setup-without-server-share; missing
  key_proof rejected); obsolete RecoveryProbeEvidenceTests retired (the
  endpoint it probed no longer exists)
- TrusteeRecoveryTests/RecoveryAntiAbuseTests/M1P0FixTests/RecoveryRekeyTests
  seeds updated to the KeyProof-only contract

CompleteRecovery keeps its gates: KeyProof match + approved trustee
request (current epoch, #86). Suite 977/0/39 Release+Debug, coverage
87.70%.
Sign in to join this conversation.
No description provided.