withdraw
function is vulnerable to Reentrancy attack due to lack of CEI.
https://github.com/Cyfrin/2024-06-Dussehra/blob/main/src/Dussehra.sol#L81-L89
This piece of code does not follow CEI or Checks Effects Interactions and thus it is vulnerable to an attack like the famous Reentrancy attack.
Lack of CEI allows an attacker to reenter into a function before the state changes are made and can cause severe damage to the protocol.
Reentrancy Attack
Manual Review
Always follow CEI or add a non reentrant modifier.
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.