PuppyRaffle.sol::refund() function is vulnerable to reentrancy through sendValue()
PuppyRaffle.sol::refund() function uses openzepplin Address.sol's sendValue() function to refund the calling player, Looking at the docs of this smart contract we see the following warning:
As refund() does not implement either of those techniques, it is vulnerable to rerentrancy attack.
A malicious player can use this vulnerability to drain the contract's balance.
manual review
Use -checks-effects-interactions pattern or OZ-ReentrancyGuard to mitigate this risk.
Also, Check the contract balance is > the refund before sending it to the player.
reentrancy in refund() function
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.