CVE-2023-30543: @web3 react/coinbase wallet `chainId` May Be Outdated If Vulnerability
MODERATECVE-2023-30543 is a MODERATE (CVSS 5.2) `chainid` may be outdated if vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting @web3 react/coinbase wallet libraries in the npm ecosystem. The issue involves `chainid` may be outdated if user changes chains as part of connection in @web3-react. Remediation is available by upgrading affected packages to version 8.0.35-beta.0, 8.0.27-beta, 8.0.30-beta.0, 8.0.37-beta.0.
CVE-2023-30543 at a Glance
Security Impact
CVSS: 5.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:L).
How to Fix CVE-2023-30543
To remediate this vulnerability, upgrade all affected @web3 react/coinbase wallet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @web3-react/coinbase-wallet@8.0.35-beta.0
npm install @web3-react/eip1193@8.0.27-beta
npm install @web3-react/metamask@8.0.30-beta.0
npm install @web3-react/walletconnect@8.0.37-beta.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @web3-react/coinbase-wallet
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-30543, inspect your project dependencies using npm:
npm ls @web3-react/coinbase-wallet
Analyze the terminal output to locate any version of @web3 react/coinbase wallet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.35-beta.0), your application is affected.
Note: The npm ls @web3-react/coinbase-wallet command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In @web3 react/coinbase wallet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-30543 Affected @web3 react/coinbase wallet Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@web3-react/coinbase-wallet
|
npm |
≥ 6.0.0
< 8.0.35-beta.0
|
8.0.35-beta.0
|
|
@web3-react/eip1193
|
npm |
≥ 6.0.0
< 8.0.27-beta
|
8.0.27-beta
|
|
@web3-react/metamask
|
npm |
≥ 6.0.0
< 8.0.30-beta.0
|
8.0.30-beta.0
|
|
@web3-react/walletconnect
|
npm |
≥ 6.0.0
< 8.0.37-beta.0
|
8.0.37-beta.0
|
References
Frequently Asked Questions
What is CVE-2023-30543?
Which @web3 react/coinbase wallet versions are affected?
What version fixes CVE-2023-30543?
Is @web3-react/coinbase-wallet affected?
Is @web3-react/eip1193 affected?
What is the CVSS score of CVE-2023-30543?
What CWE is associated with CVE-2023-30543?
How can I check npm dependencies for CVE-2023-30543?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8pf3-6fgr-3g3g",
"modified" : "2023-04-18T22:29:53Z",
"published" : "2023-04-18T22:29:53Z",
"aliases" : [ "CVE-2023-30543" ],
"summary" : "`chainId` may be outdated if user changes chains as part of connection in @web3-react",
"details" : "### Impact\n`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.\n\nFor 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.\n\n### Patches\nPatched in https://github.com/Uniswap/web3-react/pull/749.\nUsers of web3-react@8.0.x-beta.0 should upgrade to at least:\n - @web3-react/coinbase-wallet@^8.0.35-beta.0\n - @web3-react/eip1193@^8.0.27-beta.0\n - @web3-react/metamask@^8.0.30-beta.0\n - @web3-react/walletconnect@^8.0.37-beta.0\n\n### Workarounds\nN/A\n\n### References\nN/A\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@web3-react/coinbase-wallet"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "8.0.35-beta.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@web3-react/eip1193"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "8.0.27-beta"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 8.0.27-beta.0"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@web3-react/metamask"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "8.0.30-beta.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@web3-react/walletconnect"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "8.0.37-beta.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Uniswap/web3-react/security/advisories/GHSA-8pf3-6fgr-3g3g"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-30543"
}, {
"type" : "WEB",
"url" : "https://github.com/Uniswap/web3-react/pull/749"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Uniswap/web3-react"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-362" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-04-18T22:29:53Z",
"nvd_published_at" : "2023-04-17T22:15:10Z"
}
}