Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @openzeppelin/contracts
  4. ›
  5. GMS-2021-179

GMS-2021-179: ERC1155Supply vulnerability in OpenZeppelin Contracts

November 15, 2021

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.

References

  • github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-wmpv-c2jp-j2xg
  • github.com/advisories/GHSA-wmpv-c2jp-j2xg

Code Behaviors & Features

Detect and mitigate GMS-2021-179 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 4.2.0 before 4.3.3

Fixed versions

  • 4.3.3

Solution

Upgrade to version 4.3.3 or above.

Source file

npm/@openzeppelin/contracts/GMS-2021-179.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:33 +0000.