Summary
ERC1155Supply vulnerability in OpenZeppelin Contracts
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.
Workarounds
If accurate supply is relevant, do not mint tokens to untrusted receivers.
Credits
The issue was identified and reported by @ChainSecurityAudits.
For more information
Read TotalSupply Inconsistency in ERC1155 NFT Tokens by @ChainSecurityAudits for a more detailed breakdown.
If you have any questions or comments about this advisory, email us at [email protected].
Impact
If 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.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
A fix is included in version 4.3.3 of @openzeppelin/contracts and @openzeppelin/contracts-upgradeable.
Frequently Asked Questions
- What is GHSA-WMPV-C2JP-J2XG? GHSA-WMPV-C2JP-J2XG is a low-severity security vulnerability in @openzeppelin/contracts (npm), affecting versions >= 4.2.0, < 4.3.3. It is fixed in 4.3.3.
- Which packages are affected by GHSA-WMPV-C2JP-J2XG?
@openzeppelin/contracts(npm) (versions >= 4.2.0, < 4.3.3)@openzeppelin/contracts-upgradeable(npm) (versions >= 4.2.0, < 4.3.3)
- Is there a fix for GHSA-WMPV-C2JP-J2XG? Yes. GHSA-WMPV-C2JP-J2XG is fixed in 4.3.3. Upgrade to this version or later.
- Is GHSA-WMPV-C2JP-J2XG exploitable, and should I be worried? Whether GHSA-WMPV-C2JP-J2XG is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-WMPV-C2JP-J2XG is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-WMPV-C2JP-J2XG?
- Upgrade
@openzeppelin/contractsto 4.3.3 or later - Upgrade
@openzeppelin/contracts-upgradeableto 4.3.3 or later
- Upgrade