Closed c4-submissions closed 11 months ago
141345 marked the issue as primary issue
a2rocket (sponsor) disputed
141345 marked the issue as sufficient quality report
The Warden specifies that it is possible for a "race condition" to manifest whereby a randomizer request is pending fulfillment when the randomizer of the collection the request is for has been updated.
This is indeed a correct observation, however, the Sponsor has specified that the randomizer can simply "re-fulfil" the "empty" token hashes. As such, I consider this to be a QA issue that arises from the misconfiguration of the collection + can be rectified by the person responsible for the misconfiguration.
The Sponsor should consider a "graceful" upgrade system whereby the randomizer can be first paused and then upgraded to prevent this behavior from ever arising.
alex-ppg changed the severity to QA (Quality Assurance)
alex-ppg marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L229
Vulnerability details
Impact
There is way in which the generator will not produce a hash value, besides the lack of funds on the VRF. MinterContract
MinterContract::mint() call genCore contract mint function, which internally calls
_mintProcessing
function.As it can be seen, before minting the token, it perform
calculateTokenHash
call on the randomizer contract.The function validates caller, followed by requesting chainlink
requestRandomWords
. And after minimum block confirmation(currently set to 3) coordinator call fullfillRandomWords, which sets tokenHash for the minted tokenId above.The issue here is, the presence of
addRandomizer()
function on gencore contract. This function allows owner to update randomizer contract when it required, means if owner unaware of unset tokenHash(will set by fullfillRandomWords call) for the tokens minted in past block then any future fullfillRandomWords call for those tokenId will revert. Because only newRandomizer contract can call the setTokenHash,Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Tools Used
Manual review
Recommended Mitigation Steps
Remove the
addRandomizer
functionAssessed type
Other