Skip to content

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

Moderate severity GitHub Reviewed Published Apr 17, 2023 in Uniswap/web3-react • Updated Nov 11, 2023

Package

npm @web3-react/coinbase-wallet (npm)

Affected versions

>= 6.0.0, < 8.0.35-beta.0

Patched versions

8.0.35-beta.0
npm @web3-react/eip1193 (npm)
>= 6.0.0, < 8.0.27-beta.0
8.0.27-beta
npm @web3-react/metamask (npm)
>= 6.0.0, < 8.0.30-beta.0
8.0.30-beta.0
npm @web3-react/walletconnect (npm)
>= 6.0.0, < 8.0.37-beta.0
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 Uniswap/web3-react#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

References

@AndrewMohawk AndrewMohawk published to Uniswap/web3-react Apr 17, 2023
Published by the National Vulnerability Database Apr 17, 2023
Published to the GitHub Advisory Database Apr 18, 2023
Reviewed Apr 18, 2023
Last updated Nov 11, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:L

EPSS score

0.070%
(32nd percentile)

Weaknesses

CVE ID

CVE-2023-30543

GHSA ID

GHSA-8pf3-6fgr-3g3g

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.