Closed kcole16 closed 2 years ago
Specifically, I think final version of this can look:
This addresses all the attack vectors:
@ilblackdragon what if friends collude to steal your phone 😂
Expanding on @ilblackdragon's comments:
Prevent attackers from
For any account, there are minimum three keys
TXs require 2-of-3 multi-sig
cc @vgrichina @Patrick1904
This is great. My only concern earlier when we discussed this was with:
- Server signs and sends TX
If it's a contract needing a second signature only, it should be fine. The server key must not have any ability to do anything except be a second signature.
Questions
What if the user needs to recover their account? Are we requiring recovery key + server key? Or is the recovery key just another version of the local storage key that we sent to them?
Lastly, because we sent them the recovery key (probably a seed phrase that recreates the localstorage key???), we probably should make certain that we've scrubbed all record of this from our servers, email servers, logs, etc... Since we technically have the 2/3 we need at some point in time. I'm still not happy about sending a recovery key in plaintext. At the very least we should throw a weak encryption around the recovery phrase based on a PIN and some client side JS.
Proposals
WRT keys to generate locally:
The second remote key:
What if the user needs to recover their account? Are we requiring recovery key + server key? Or is the recovery key just another version of the local storage key that we sent to them?
There needs to be 2 options: 1) normal recovery flow (recovery link key + our 2FA key) 2) gain full access when NEAR 2FA isn't accessible but you still have local storage key (local storage key + recovery link key).
At the very least we should throw a weak encryption around the recovery phrase based on a PIN and some client side JS.
such encryption doesn't add security (brute-forcing PIN is trivial unless it is unpractically long), but would degrade UX by a lot.
Note that as Illia outlined above (https://github.com/near/near-wallet/issues/423#issuecomment-623090551) in ideal security scenario there is no key in local storage / e-mail at all. However we can implement it only for mobile apps. Casual web wallet users have to accept bigger security risks, but this is fine as they aren't expected have a lot of value to start with. Once they have more value on account – we should steer users toward more secure options (mobile app, Ledger, etc).
we probably should make certain that we've scrubbed all record of this from our servers, email servers, logs, etc...
agree with this 100%, we need to make sure SendGrid/Twilio doesn't keep message bodies.
Two questions:
Expanding on Create account with 2FA
createAccount
function on Linkdrop contract is called
cc @mattlockyer @ilblackdragon @vgrichina @corwinharrell @Patrick1904
Closing as issue is outdated
Overview
Adding support for multi-sig based 2FA will make the web wallet more secure. This will require deploying a contract to wallet users' accounts, and will allow them to specify which transactions require multi-sig.
Stories
As a user, I want to set limits on my transaction amounts, requiring two factor authentication above the limits, so I can use the web wallet to safely store $100-$1000 worth of assets.
Flows
For any account, there are minimum three keys
1 key in localStorage 1 key in recovery 1 key on our server
TXs require 2-of-3 multi-sig
Create account with 2FA
/create
createAccount
function on Linkdrop contract is calledSign TX with 2FA
Recover with 2FA (Email)
/recover-with-link
Recover with 2FA (Seed)
/recover-seed-phrase