mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-21 17:28:40 +02:00
Adversarial review (Identity Phase 1 flow) findings: - Canonicalize the pubkey returned by verify_nip98 / verify_signed_action to lowercase hex. BIP-340 hex-decode is case-insensitive, so an UPPER-case-hex pubkey is a fully self-consistent, verifying event — but stored/looked-up verbatim it would let ONE key bind to two accounts via case variance (bypassing the UNIQUE index + 409) and yield non-canonical NIP-05 output. Now every downstream store/compare/lookup is on the canonical form. +KAT. - nostr_link records a login event on success: a session-authed link (including a rotation that REPLACES an existing npub) is a security-relevant binding change and must not be silent. - Tighten NIP98_LOGIN_MAX_AGE_SECS 60 -> 30s: a captured login token is a bearer credential within the window; match it to the state-change grade.