GHSA-wmpv-c2jp-j2xg: @openzeppelin/contracts ERC1155Supply Vulnerability Vulnerability
LOWGHSA-wmpv-c2jp-j2xg is a LOW erc1155supply vulnerability vulnerability (General Security Weakness) affecting @openzeppelin/contracts libraries in the npm ecosystem. The issue involves erc1155supply vulnerability in openzeppelin contracts. Remediation is available by upgrading affected packages to version 4.3.3.
GHSA-wmpv-c2jp-j2xg at a Glance
How to Fix GHSA-wmpv-c2jp-j2xg
To remediate this vulnerability, upgrade all affected @openzeppelin/contracts 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 @openzeppelin/contracts@4.3.3
npm install @openzeppelin/contracts-upgradeable@4.3.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @openzeppelin/contracts
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-wmpv-c2jp-j2xg, inspect your project dependencies using npm:
npm ls @openzeppelin/contracts
Analyze the terminal output to locate any version of @openzeppelin/contracts in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.3), your application is affected.
Note: The npm ls @openzeppelin/contracts 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 General Security Weakness. In @openzeppelin/contracts, 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
GHSA-wmpv-c2jp-j2xg Affected @openzeppelin/contracts Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@openzeppelin/contracts
|
npm |
≥ 4.2.0
< 4.3.3
|
4.3.3
|
|
@openzeppelin/contracts-upgradeable
|
npm |
≥ 4.2.0
< 4.3.3
|
4.3.3
|
References
Frequently Asked Questions
What is GHSA-wmpv-c2jp-j2xg?
Which @openzeppelin/contracts versions are affected?
What version fixes GHSA-wmpv-c2jp-j2xg?
Is @openzeppelin/contracts affected?
Is @openzeppelin/contracts-upgradeable affected?
What CWE is associated with GHSA-wmpv-c2jp-j2xg?
How can I check npm dependencies for GHSA-wmpv-c2jp-j2xg?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wmpv-c2jp-j2xg",
"modified" : "2021-11-15T22:27:38Z",
"published" : "2021-11-15T23:28:18Z",
"aliases" : [ ],
"summary" : "ERC1155Supply vulnerability in OpenZeppelin Contracts",
"details" : "When ERC1155 tokens are minted, a callback is invoked on the receiver of those tokens, as required by the spec. When including the `ERC1155Supply` extension, total supply is not updated until after the callback, thus during the callback the reported total supply is lower than the real number of tokens in circulation.\n\n### Impact\nIf a system relies on accurately reported supply, an attacker may be able to mint tokens and invoke that system after receiving the token balance but before the supply is updated.\n\n### Patches\nA fix is included in version 4.3.3 of `@openzeppelin/contracts` and `@openzeppelin/contracts-upgradeable`.\n\n### Workarounds\nIf accurate supply is relevant, do not mint tokens to untrusted receivers.\n\n### Credits\nThe issue was identified and reported by @ChainSecurityAudits.\n\n### For more information\nRead [TotalSupply Inconsistency in ERC1155 NFT Tokens](https://medium.com/chainsecurity/totalsupply-inconsistency-in-erc1155-nft-tokens-8f8e3b29f5aa) by @ChainSecurityAudits for a more detailed breakdown.\n\nIf you have any questions or comments about this advisory, email us at security@openzeppelin.com.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@openzeppelin/contracts"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.2.0"
}, {
"fixed" : "4.3.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@openzeppelin/contracts-upgradeable"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.2.0"
}, {
"fixed" : "4.3.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-wmpv-c2jp-j2xg"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/OpenZeppelin/openzeppelin-contracts"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2021-11-15T22:27:38Z",
"nvd_published_at" : null
}
}