decision: a connected site can switch the wallet's network with no prompt #408

Open
opened 2026-09-21 20:37:56 +02:00 by clawbot · 0 comments
Collaborator

Severity: hardening. Owner decision.

Where. src/background/index.js:725-772 (wallet_switchEthereumChain, gated
on connection only).

The behaviour. wallet_switchEthereumChain is gated on the site being
connected, then rewrites networkId, rpcUrl and blockscoutUrl, clears
balances and caches, and broadcasts chainChanged to every tab — with no user
confirmation. The README (TxApproval section) documents the connection gate as
the fix for an unconnected page clearing the [TESTNET] banner, but a connected
site can still flip the network silently between the two supported chains.

The question. Should a chain switch require a prompt? A connected dApp moving
the user from Sepolia to mainnet (or back) before a send is silent; the send
screen does show the network, but the user may not re-read it.

Options.

  • Prompt on every wallet_switchEthereumChain, as other wallets do.
  • Keep it promptless and make the switch conspicuous on the next approval screen.

Recommendation. Keep it promptless for the two supported chains but surface
the active network prominently on the very next approval; a prompt on every
switch is friction for a wallet that supports only mainnet and one testnet.

Definition of done.

  • The owner rules prompt vs promptless.
  • The chosen behaviour is implemented and the README matches it.

Model: fable-5-1 (review); opus-4-8 (filing)

Severity: hardening. Owner decision. **Where.** `src/background/index.js:725-772` (`wallet_switchEthereumChain`, gated on connection only). **The behaviour.** `wallet_switchEthereumChain` is gated on the site being connected, then rewrites `networkId`, `rpcUrl` and `blockscoutUrl`, clears balances and caches, and broadcasts `chainChanged` to every tab — with no user confirmation. The README (TxApproval section) documents the connection gate as the fix for an unconnected page clearing the `[TESTNET]` banner, but a connected site can still flip the network silently between the two supported chains. **The question.** Should a chain switch require a prompt? A connected dApp moving the user from Sepolia to mainnet (or back) before a send is silent; the send screen does show the network, but the user may not re-read it. **Options.** - Prompt on every `wallet_switchEthereumChain`, as other wallets do. - Keep it promptless and make the switch conspicuous on the next approval screen. **Recommendation.** Keep it promptless for the two supported chains but surface the active network prominently on the very next approval; a prompt on every switch is friction for a wallet that supports only mainnet and one testnet. **Definition of done.** - [ ] The owner rules prompt vs promptless. - [ ] The chosen behaviour is implemented and the README matches it. Model: fable-5-1 (review); opus-4-8 (filing)
sneak was assigned by clawbot 2026-09-21 20:37:56 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#408