Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: wallet_addEthereumChain adds new default RPC URL without confirmation #12850

Open
christopherferreira9 opened this issue Jan 7, 2025 · 0 comments
Labels
regression-prod-7.38.0 Regression bug that was found in production in release 7.38.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing type-bug Something isn't working

Comments

@christopherferreira9
Copy link
Contributor

christopherferreira9 commented Jan 7, 2025

Describe the bug

Following extension, when wallet_addEthereumChain is called for an existing chain, before the active chain switches the user is presented with a confirmation screen warning that a different RPC url is going to be added.
Without this confirmation screen we might be bumping into a phishing potential (see MetaMask/metamask-extension#16712) .

Expected behavior

The user is presented with a confirmation screen warning the user that a new RPC url for the chain he's trying to add is going to be added to the RPC list and this will turn into the default active RPC.

Screenshots/Recordings

overridingrpcurl.mov

Steps to reproduce

  1. Add Polygon in MetaMask and switch back to Mainnet
  2. Open this dapp on the inapp browser
  3. Tap request accounts and connect while having Mainnet as the active chain
  4. Tap AddEthereumChain
  5. Go to the list of chains in the wallet and verify the list of RPC urls under the Polygon

Error messages or log output

Detection stage

In production (default)

Version

7.38.0

Build type

None

Device

iPhone 11

Operating system

iOS, Android

Additional context

Call being made under the AddEthereumChain button:

{
  method: 'wallet_addEthereumChain',
  params: [{
    chainId: '0x89',
    chainName: 'Polygon',
    blockExplorerUrls: ['https://polygonscan.com'],  // notice that this RPC url is different than the one preloaded in MetaMask
    nativeCurrency: { symbol: 'POL', decimals: 18 },
    rpcUrls: ['https://polygon-rpc.com/'],
  }]
}

Severity

No response

@christopherferreira9 christopherferreira9 added the type-bug Something isn't working label Jan 7, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Jan 7, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Jan 7, 2025
@christopherferreira9 christopherferreira9 added the Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing label Jan 7, 2025
@metamaskbot metamaskbot added the regression-prod-7.38.0 Regression bug that was found in production in release 7.38.0 label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-prod-7.38.0 Regression bug that was found in production in release 7.38.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing type-bug Something isn't working
Projects
Status: To be fixed
Status: To be fixed
Development

No branches or pull requests

2 participants