GitHub Advisoryadvisory · npm

GHSA-8pf3-6fgr-3g3g `chainId` may be outdated if user changes chains as part of connection in @web3-react

MEDIUM Published 2023-04-18 Modified 2023-04-18 Official page ↗
Aliases
CVE-2023-30543
Ecosystem
npm
Packages
@web3-react/coinbase-wallet, @web3-react/eip1193, @web3-react/metamask, @web3-react/walletconnect
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:L
Weaknesses
CWE-362
Reviewed
2023-04-18

Affected packages

• npm @web3-react/coinbase-wallet: >= 6.0.0, < 8.0.35-beta.0 → fixed in 8.0.35-beta.0 • npm @web3-react/eip1193: >= 6.0.0, < 8.0.27-beta → fixed in 8.0.27-beta • npm @web3-react/metamask: >= 6.0.0, < 8.0.30-beta.0 → fixed in 8.0.30-beta.0 • npm @web3-react/walletconnect: >= 6.0.0, < 8.0.37-beta.0 → fixed in 8.0.37-beta.0

Description

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`, 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 [email protected] 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

Related

Alias · CVE (1)

  • CVE-2023-30543 @web3-react is a framework for building Ethereum Apps . vulnerability

Weakness · CWE (1)

  • CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization weakness

References