Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Potential DoS Due to Revert in fulfillRandomWords Function

Summary

The fulfillRandomWords function might revert due to multiple reasons. According to Chainlink VRF documentation, a revert in fulfillRandomWords prevents the VRF service from attempting a second call.

Vulnerability Details

Several scenarios within the fulfillRandomWords function can lead to transaction reverting:

  1. If the recent_winner is a contract account but does not implement the onERC721Received function or returns an incorrect value.

  2. If the recent_winner is a contract account without receive or fallback functions, resulting in an inability to receive ether and leading to a revert.

  3. If the recent_winner is a contract account, insufficient gas forwarded may lead to an out-of-gas problem during execution.

Any of these scenarios will result in a transaction revert, preventing the VRF service from calling fulfillRandomWords again, thus preventing the update of the raffle_state.

Impact

The inability to update the raffle_state variable due to transaction reverting could prevent the system from going to the next round, potentially disrupting the functionality of the contract.

Tools Used

Manual Review

Recommendations

Ensure that the fulfillRandomWords function is solely responsible for storing the random variable and does not contain any logic that could lead to reverting transactions. It should be designed to never revert, thereby preventing potential DoS attacks and ensuring the smooth operation of the system.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Winner can be a contract that refuses ETH and brinks the whole contract + reverts on Chainlink VRF

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.