Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: medium
Invalid

A griefer can call flash loan to call executeOperation and spend any profits left in the flash loan receiver contract

Summary

Anyone can call the flash loan function, which in turn calls the executeOperation function in the MockFlashLoanReceiver contract with parameters that spend any profits left in MockFlashLoanReceiver after another person's flash loan. People borrow flash loans to make a profit, so MockFlashLoanReceiver should end up with more than just amount + fee after a flash loan is done. But only amount + fee is returned to the ThunderLoan contract. If a borrower doesn't send its profit out of the MockFlashLoanReceiver contract, a griefer can come behind them and call flash loan with parameters that spend the previous borrower's profits.

Impact

A borrower could lose their profits.

Tools Used

Manual review

Recommendations

Borrower should not keep their profits in the flash loan receiver contract

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Mock contracts issue

Support

FAQs

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