Thunder Loan

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

Centralization risk — a single owner key can arbitrarily change the flash‑loan fee and upgrade the entire protocol with no delay or cap

Root + Impact

Description


  • ThunderLoan::updateFlashLoanFee lets onlyOwner set s_flashLoanFee
    to anything up to s_feePrecision (i.e. up to 100%) instantly, with no timelock and no notice to
    active users. Separately, _authorizeUpgrade gates UUPS upgrades with only onlyOwner, so
    the same key can swap out the entire implementation at any time (as demonstrated by the storage‑
    collision scenario in [H‑1])

// Root cause in the codebase with @> marks to highlight the relevant section

Risk

Likelihood:

  • A single compromised, malicious, or simply mistaken owner key can (1) front‑run/grief a
    pending flash loan by spiking the fee toward 100% right before it executes, or (2) push an arbitrary
    new implementation via upgradeTo with no window for LPs to react or exit beforehand:

  • Impact 1

    A single compromised, malicious, or simply mistaken owner key can (1) front‑run/grief a
    pending flash loan by spiking the fee toward 100% right before it executes, or (2) push an arbitrary
    new implementation via upgradeTo with no window for LPs to react or exit beforehand

Proof of Concept

​

Recommended Mitigation

Route owner‑only actions (fee changes and upgrades) through a
timelock or multisig with a mandatory delay, giving users a window to withdraw before a change
takes effect. ‑ Cap updateFlashLoanFee to a sane maximum well below 100%, rather than
s_feePrecision.
Low
[L‑1] ThunderLoan::flashloan has no reentrancy guard and no restriction on
which tokens can be listed
Severity: Low
Description: flashloan()handscontroltoanarbitraryreceiverAddressviafunctionCall
mid‑execution. Neither it nor deposit()/redeem() carry a nonReentrant guard — no
ReentrancyGuardisevenimported. Thefinalbalancecheckinflashloan()(endingBalance
< startingBalance + fee) happens to still hold under naive reentrancy today, but that’s
Bhavya Jain 12
​
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 1 month 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!