If either collectionId or itemId is allowed to be 128 bits or greater, collisions can occur. For example:
(collectionId: 1, itemId: 0) → tokenId = 2^128
(collectionId: 0, itemId: 2^128) → tokenId = 2^128
Both pairs produce the same tokenId, meaning two different NFTs would be indistinguishable in the system.
The contract uses the following logic to combine a collectionId and an itemId into a single ERC1155 token ID:
This is intended to uniquely encode a pair of 128-bit values into a single 256-bit value
Likelihood:
This bug can lead to loss of uniqueness, data corruption, and potential exploits.
Token ID Collision:
Different (collectionId, itemId) pairs can map to the same tokenId.
Loss of Uniqueness:
This breaks the uniqueness guarantee of token IDs, which can lead to:
Incorrect ownership tracking
Metadata confusion
Potential exploits (e.g., minting or transferring unintended NFTs)
Enforce 128-bit Limits:
Add require statements to ensure both collectionId and itemId are strictly less than 2^128:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.