GHSA-wmpv-c2jp-j2xg
ERC1155Supply vulnerability in OpenZeppelin Contracts
- Severity
- Low
- The publisher's own rating, not a CVSS score
- Exploit chance (EPSS)
- —
- No score published
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- —
- Not classified
- Fix
- Available
- 2 packages have a fixed version
Description
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.
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.
Patches
A fix is included in version 4.3.3 of @openzeppelin/contracts and @openzeppelin/contracts-upgradeable.
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 security@openzeppelin.com.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| @openzeppelin/contracts | >= 4.2.0, < 4.3.3 |
4.3.3 |
| @openzeppelin/contracts-upgradeable | >= 4.2.0, < 4.3.3 |
4.3.3 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
@openzeppelin/contracts npm → 4.3.3
- npm
npm install @openzeppelin/contracts@4.3.3- yarn
yarn add @openzeppelin/contracts@4.3.3- pnpm
pnpm add @openzeppelin/contracts@4.3.3
@openzeppelin/contracts-upgradeable npm → 4.3.3
- npm
npm install @openzeppelin/contracts-upgradeable@4.3.3- yarn
yarn add @openzeppelin/contracts-upgradeable@4.3.3- pnpm
pnpm add @openzeppelin/contracts-upgradeable@4.3.3
References
Packages
Other links
Timeline
- Last updated by the source
- Published
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-9rcw-c2f9-2j55 OpenZeppelin Contracts Bytes's lastIndexOf function with position argument performs out-of-bound memory access on empty buffers | Medium | Also affects @openzeppelin/contracts |
| GHSA-9vx6-7xxf-x967 OpenZeppelin Contracts base64 encoding may read from potentially dirty memory | High | Also affects @openzeppelin/contracts |
| GHSA-699g-q6qh-q4v8 OpenZeppelin Contracts and Contracts Upgradeable duplicated execution of subcalls in v4.9.4 | High | Also affects @openzeppelin/contracts |
| GHSA-g4vp-m682-qqmp OpenZeppelin Contracts vulnerable to Improper Escaping of Output | Medium | Also affects @openzeppelin/contracts |
| GHSA-wprv-93r4-jj2p OpenZeppelin Contracts using MerkleProof multiproofs may allow proving arbitrary leaves for specific trees | Medium | Also affects @openzeppelin/contracts |
| GHSA-5h3x-9wvq-w4m2 OpenZeppelin Contracts's governor proposal creation may be blocked by frontrunning | Medium | Also affects @openzeppelin/contracts |
| GHSA-mx2q-35m2-x2rh OpenZeppelin Contracts TransparentUpgradeableProxy clashing selector calls may not be delegated | Medium | Also affects @openzeppelin/contracts |
| GHSA-93hq-5wgc-jc82 GovernorCompatibilityBravo may trim proposal calldata | High | Also affects @openzeppelin/contracts |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor