`chainId` may be outdated if user changes chains as part of connection in @web3-react
Uniswap web3-react
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @web3-react/coinbase-wallet npm |
|
|
| @web3-react/eip1193 npm |
|
|
| @web3-react/metamask |
Uniswap web3-react
| Product | Affected | Fixed in |
|---|---|---|
| @web3-react/coinbase-wallet npm |
|
|
| @web3-react/eip1193 npm |
|
|
| @web3-react/metamask |
|
|
| @web3-react/walletconnect npm |
|
|
@web3-react is a framework for building Ethereum Apps . In affected versions the `chainId` may be outdated if the user changes chains as part of the connection flow. This means that the value of `chainId` returned by `useWeb3React()` may be incorrect. In an application, this means that any data derived from `chainId` could be incorrect. For example, if a swapping application derives a wrapped token contract address from the `chainId` *and* a user has changed chains as part of their connection flow the application could cause the user to send funds to the incorrect address when wrapping. This issue has been addressed in PR #749 and is available in updated npm artifacts. There are no known workarounds for this issue. Users are advised to upgrade.
From the CVE record · GitHub_M
During a connection flow, a user changing chains can leave the chainId returned by useWeb3React() outdated. Applications that derive data from it may use incorrect values; for example, a swapping app could direct funds to the wrong address when wrapping a token. No attacker action is described.
Check applications using @web3-react/coinbase-wallet, @web3-react/eip1193, @web3-react/metamask, or @web3-react/walletconnect versions from 6.0.0 up to their respective fixed versions.