NetSight
medium5.2

CVE-2023-30543

`chainId` may be outdated if user changes chains as part of connection in @web3-react

Impact

### Impact `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 is a common approach when using other foundational libraries like [`ethers`](https://github.com/ethers-io/ethers.js), and most users of v8 will want to upgrade past the affected versions. ### Patches Patched in https://github.com/Uniswap/web3-react/pull/749. Users of web3-react@8.0.x-beta.0 should upgrade to at least: - @web3-react/coinbase-wallet@^8.0.35-beta.0 - @web3-react/eip1193@^8.0.27-beta.0 - @web3-react/metamask@^8.0.30-beta.0 - @web3-react/walletconnect@^8.0.37-beta.0 ### Workarounds N/A ### References N/A

Affected packages

EcosystemPackageAffectedFixed in
npm@web3-react/coinbase-wallet>= 6.0.0, < 8.0.35-beta.08.0.35-beta.0
npm@web3-react/eip1193>= 6.0.0, < 8.0.27-beta.08.0.27-beta
npm@web3-react/metamask>= 6.0.0, < 8.0.30-beta.08.0.30-beta.0
npm@web3-react/walletconnect>= 6.0.0, < 8.0.37-beta.08.0.37-beta.0

Affected products

VendorProductAffected versions
UniswapWeb3-React Coinbase-Wallet
from 6.0.0 through 6.2.14
Versions 7.0.0, 7.0.1, 7.0.2, 8.0.22, 8.0.23
UniswapWeb3-React Eip1193
from 6.0.0 through 6.2.14
Versions 7.0.0, 7.0.1, 7.0.2, 8.0.0, 8.0.1
UniswapWeb3-React Metamask
from 6.0.0 through 6.2.14
Versions 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4
UniswapWeb3-React Walletconnect
from 6.0.0 through 6.2.14
Versions 7.0.0, 7.0.1, 7.0.2, 8.0.0, 8.0.1

Weakness classification

References