A reentrancy exploit is possible within the Dussehra:: Withdraw
function due to the function not following the strucutre of CEI (Check, Effects, Interactions) the external call is made before the state being changed, therefore making the attack possible.
To correctly test and verify, please do the following.
Import the following library into Dussehra.t.sol - import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
Copy and paste the following test and malicious contract to verify the reentrancy attack is possible.
High impact, as a malicious actor can essentially drain the entire Dussehra contracts of funds.
Slither, manual analysis and chat gpt
Importing and then inheriting Openzeppelin's Reentrancy Guard contract, further protects this contract from reentrancy attacks
Then making Dussehra::withdraw
Non Rentrant
would assist in further protecting this function from the reentrancy exploit.
The `withdraw` function sends the given amount to Ram. If the attacker calls the `withdraw` function again before the state variable is changed, the function will revert because there are no more funds in the contract. This reentrancy has no impact for the protocol. It is recommended to follow the CEI pattern, but this is informational.
The `withdraw` function sends the given amount to Ram. If the attacker calls the `withdraw` function again before the state variable is changed, the function will revert because there are no more funds in the contract. This reentrancy has no impact for the protocol. It is recommended to follow the CEI pattern, but this is informational.
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.