GHSA-wmpv-c2jp-j2xg

Suggest an improvement
Source
https://github.com/advisories/GHSA-wmpv-c2jp-j2xg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/11/GHSA-wmpv-c2jp-j2xg/GHSA-wmpv-c2jp-j2xg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wmpv-c2jp-j2xg
Published
2021-11-15T23:28:18Z
Modified
2021-11-15T22:27:38Z
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.

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.

Database specific
{
    "cwe_ids": [],
    "github_reviewed": true,
    "github_reviewed_at": "2021-11-15T22:27:38Z",
    "nvd_published_at": null,
    "severity": "LOW"
}
References

Affected packages

npm / @openzeppelin/contracts

Package

Name
@openzeppelin/contracts
View open source insights on deps.dev
Purl
pkg:npm/%40openzeppelin/contracts

Affected ranges

Type
SEMVER
Events
Introduced
4.2.0
Fixed
4.3.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/11/GHSA-wmpv-c2jp-j2xg/GHSA-wmpv-c2jp-j2xg.json"

npm / @openzeppelin/contracts-upgradeable

Package

Name
@openzeppelin/contracts-upgradeable
View open source insights on deps.dev
Purl
pkg:npm/%40openzeppelin/contracts-upgradeable

Affected ranges

Type
SEMVER
Events
Introduced
4.2.0
Fixed
4.3.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/11/GHSA-wmpv-c2jp-j2xg/GHSA-wmpv-c2jp-j2xg.json"