Medium

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

  • Disclosed: 18.04.2023
  • Updated: 11.10.2026 10:22

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 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 software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @web3-react/coinbase-wallet >= 6.0.0, < 8.0.35-beta.0 8.0.35-beta.0
npm package @web3-react/eip1193 >= 6.0.0, < 8.0.27-beta 8.0.27-beta
npm package @web3-react/metamask >= 6.0.0, < 8.0.30-beta.0 8.0.30-beta.0
npm package @web3-react/walletconnect >= 6.0.0, < 8.0.37-beta.0 8.0.37-beta.0

References

CVSS score 5.2/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:L
Weakness (CWE)
CWE-362
Platform
npm
Package
@web3-react/coinbase-wallet, @web3-react/eip1193, @web3-react/metamask
Disclosed
18.04.2023
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-8pf3-6fgr-3g3g - CC BY 4.0

Vulnerability history: @web3-react/metamask

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.