Thunder Loan

AI First Flight #7
Beginner FriendlyFoundryDeFiOracle
EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Flash loan can be repaid with deposit() to drain all funds

The flashloan check uses token.balanceOf which is manipulated by deposit.


Root: flashloan() validates repayment with endingBalance = token.balanceOf(assetToken). But deposit() also increases that balance and mints AssetTokens.


Attack:

1. Attacker flashloans 1000 tokens

2. In callback, calls deposit(token, 1000+fee) -> passes balance check + gets AssetTokens

3. Calls redeem() to drain all LPs funds


Impact: High - total loss of protocol

Likelihood: High - easy to exploit


Fix: block deposit during flashloan

if (s_currentlyFlashLoaning[token]) revert;

Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 1 hour ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!