-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no way to resend a request to the randomizer #1355
Comments
141345 marked the issue as duplicate of #1307 |
related to #1464 |
alex-ppg marked the issue as unsatisfactory: |
Thanks for judging. Also, sponsor said: "If the tokenHash has not been set an admin can deploy a contract that can call the RNG for that specific id, the hash will be generated and stored". RNG randoms is not the same as VRF. If before this, randomizer was VRF, users would like, that hash will set exactly by VRF. "The contracts will be fully funded to cover the costs." - its just promise, Yes, owner is trusted, but could be different situations .. |
Hey @SovaSlava, thanks for your contribution! Your recommended course of action is to permit the administrator to resend a randomness request, meaning that they will have to supply the necessary funds to fulfill it. In any case, I believe such a recommendation is better suited under an Analysis or QA submission and cannot constitute a medium-severity vulnerability, rendering my initial verdict to remain. |
@alex-ppg Thanks for answer. So..may be you can grade this issue as qa grade-b, please? |
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L178-L184
Vulnerability details
Impact
In the contract, when minting NFT, a request is sent to the randomizer to obtain a random hash. In cases where a randomizer from chainlink or arrng is used, then the hash request is an asynchronous operation. The hash is established after several blocks after the NFT mint. There may be several situations when it is necessary to re-send the request to the randomizer. But there is no such possibility in the contract.
Chainlink uses a subscription method to pay for its work. First you need to top up your subscription balance with tokens and with each hash request, chainlink tokens will be debited from the subscription balance. If the balance is not sufficient to pay for the request, it is enough to top up the subscription balance within the next 24 hours. And after that, the chainlink itself will send a random number to the contract.
If you do not replenish the balance within 24 hours, then in order to receive a random number, it is necessary for the contract to send a request to the chainlink again. But there is no such possibility. Even the project administrator.
It may happen that the subscription balance runs out, and the project owner does not have time to replenish it. In this case, NFTs that users have without a hash will remain forever without it.
This is not about the fact that the project owner will not replenish the account on purpose, but about the fact that this can happen by accident, under different circumstances. There is a risk that the administrator simply will not have time to top up the subscription account within 24 hours. And it must be taken into account.
Proof of Concept
The request to the randomizer is sent only from internal function NextGenCore._mintProcessing() such when minting NFT and it is impossible to send it again
Tools Used
Manual review
Recommended Mitigation Steps
Add function, which give opportunity to admin resend request to randomizer.
It is safe opportunity, because in function NextGenCore.setTokenHash() there is check, that hash is still bytes32(0). So, if even admin call function after success request to randomizer, it will not cause problem.
Assessed type
Oracle
The text was updated successfully, but these errors were encountered: