B-2 SECURITY: wallet DID auto-link overwrites victim's Did — account takeover #33

Closed
opened 2026-11-03 08:23:58 +01:00 by amiryahaya · 1 comment
Owner

RegisterVerify.cs:84-119: when a wallet VC's client-asserted email claim matches an existing user, that user's Did is overwritten with the attacker-registered DID (no verification, no null-check on existing Did). Authenticate.cs:44-52 then logs in purely by Did → full session on the victim's account. Attack: register DID with SharedClaims.email = victim@example.com.

Fix (minimum): link only when existingByEmail.Did is null AND email is verified (or re-verify via OTP); otherwise 409. Enforce again in the unified provisioning service (#19 / task 1.4). Add regression test: DID-overwrite attempt rejected.

Related: C-2/IDA-09 (#19, #25), Full findings + evidence: docs/redesign/2026-11-onboarding-passkey/08-code-baseline-review.md

RegisterVerify.cs:84-119: when a wallet VC's client-asserted email claim matches an existing user, that user's Did is overwritten with the attacker-registered DID (no verification, no null-check on existing Did). Authenticate.cs:44-52 then logs in purely by Did → full session on the victim's account. Attack: register DID with SharedClaims.email = victim@example.com. Fix (minimum): link only when existingByEmail.Did is null AND email is verified (or re-verify via OTP); otherwise 409. Enforce again in the unified provisioning service (#19 / task 1.4). Add regression test: DID-overwrite attempt rejected. Related: C-2/IDA-09 (#19, #25), Full findings + evidence: docs/redesign/2026-11-onboarding-passkey/08-code-baseline-review.md
Author
Owner

Fixed in 603e33c (TDD: DidAutoLinkTests red → green).

  • Wallet registration with a claimed email belonging to a different account → 409, victim account untouched (regression test asserts Did unchanged + attacker DID not registered)
  • Email auto-link block removed entirely — wallet-loss recovery goes through trustee recovery (KEY-08)
  • Own-DID re-registration with same email still allowed

Known limitation (documented): new-user path can still squat an unclaimed email (EmailVerified=false) — deprecated wallet path, resolved by Phase 2 IdP switch.

Verified: 3 consecutive green runs (682/682 ×3, Release).

**Fixed in `603e33c`** (TDD: DidAutoLinkTests red → green). - Wallet registration with a claimed email belonging to a different account → **409**, victim account untouched (regression test asserts Did unchanged + attacker DID not registered) - Email auto-link block removed entirely — wallet-loss recovery goes through trustee recovery (KEY-08) - Own-DID re-registration with same email still allowed Known limitation (documented): new-user path can still squat an unclaimed email (EmailVerified=false) — deprecated wallet path, resolved by Phase 2 IdP switch. **Verified: 3 consecutive green runs (682/682 ×3, Release).**
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
primatekuntech/failsulit#33
No description provided.