the ThunderLoan contract and the upgradeThunderLoan contract is vulnerable to a flashloan deposit attack
An attacker can take out a flashloan and deposit it into the contract without actually paying it back. The attacker can then withdraw the flashloan deposit.
An attacker can use this to drain all funds in the contract by taking as many flashloans as possible.
https://gist.github.com/Falilah/470de5a2c297f8f775b7b24a51a28cbb
manual review, foundry
To fix this, the team should update the deposit function to check that the token is not currently flashloaning by using a modifier or use the s_currentlyFlashLoaning[token]
variable to check the status of the token user want to deposit at every point in time.
suggested code to fix is as follows:
Add another error message error ThunderLoan__CurrentlyFlashLoaning();
and check in the deposit function to be sure token is not currently flashloaning before user can deposit i.e
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.