The refund function is vulnerable to re-entrancy attack and can be used to drain the contract balance
The refund function is vulnerable to re-entrancy attack and can be used to drain the contract balance. Specifically, an external call is made via:
while the function itself is not protected against re-entrancy.
For a POC, Create this contract:
Add this test to PuppyRaffleTest:
The refund function can be used to drain the contract balance
Manual review
Use Openzeppelin ReentrancyGuard contract and apply the nonReentrant modifier on the refund function.
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.