MetaMask / MetaMask/metamask-extension

Potential vulnerability with web3.personal.sign as authentication mechanism

Open
#1,839 18 comments 4 reactions 0 assignees View on GitHub
area-api type-discussion type-enhancement type-security
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

Problem:
Suppose mysensitiveinfo.com uses `web3.personal.sign` for authentication.
malicious.com is another website that lures users into authenticating. When a user asks for a challenge message for her to sign for address A, malicious.com's server requests a similar challenge for A from mysensitiveinfo.com . malicious.com then relays the challenge to the user, gets the message signed and can now log into mysensitiveinfo.com .

Possible mitigation:
Have MetaMask emulate the same-origin policy by requiring messages that are to be signed to be prefixed with the page's domain name + some delimiter.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the MetaMask handling of web3.personal.sign and the authentication flow described in the issue. Review the proposed page-domain prefix mitigation, including its effects on signed messages and existing dapps; done requires a decided, compatible approach that prevents cross-site challenge replay.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.