GHSA-wmpv-c2jp-j2xg: @openzeppelin/contracts ERC1155Supply Vulnerability Vulnerability

LOW
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-wmpv-c2jp-j2xg
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product @openzeppelin/contracts
Package Ecosystem npm
Published Date
Last Updated

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.

@openzeppelin/contracts fixed: 4.3.3
npm install @openzeppelin/contracts@4.3.3
@openzeppelin/contracts-upgradeable fixed: 4.3.3
npm install @openzeppelin/contracts-upgradeable@4.3.3
Verify Direct and Transitive Dependencies

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

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](https://medium.com/chainsecurity/totalsupply-inconsistency-in-erc1155-nft-tokens-8f8e3b29f5aa) by @ChainSecurityAudits for a more detailed breakdown. If you have any questions or comments about this advisory, email us at security@openzeppelin.com.

GHSA-wmpv-c2jp-j2xg Affected @openzeppelin/contracts Versions

2 component(s)
Fixed Versions:
4.3.3
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?
GHSA-wmpv-c2jp-j2xg is a security vulnerability in @openzeppelin/contracts involving ERC1155Supply vulnerability in OpenZeppelin Contracts under General Security Weakness.
Which @openzeppelin/contracts versions are affected?
Affected versions include releases prior to 4.3.3 across affected packages: @openzeppelin/contracts, @openzeppelin/contracts-upgradeable.
What version fixes GHSA-wmpv-c2jp-j2xg?
Upgrading to 4.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @openzeppelin/contracts affected?
Yes, @openzeppelin/contracts is affected in releases prior to 4.3.3. Upgrade your dependency to 4.3.3 or later.
Is @openzeppelin/contracts-upgradeable affected?
Yes, @openzeppelin/contracts-upgradeable is affected in releases prior to 4.3.3. Upgrade your dependency to 4.3.3 or later.
What CWE is associated with GHSA-wmpv-c2jp-j2xg?
GHSA-wmpv-c2jp-j2xg is classified under General Security Weakness.
How can I check npm dependencies for GHSA-wmpv-c2jp-j2xg?
Run the dependency tree command: 'npm ls @openzeppelin/contracts'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}