flashloan verifies repayment by comparing the AssetToken's closing token balance against its opening balance plus the fee. It never records who returned the money or through which function.
deposit sends tokens to that same AssetToken address and has no flash-loan guard, so it satisfies the balance check exactly like repay — while additionally minting shares to the caller:
The borrower settles the loan with the protocol's own money and keeps a claim on it. repay is correctly gated on s_currentlyFlashLoaning, but nothing forces its use.
Likelihood: High
Any address can call flashloan with a receiver contract it controls. The attacker needs only enough capital to cover the fee, and the attack is a single transaction repeatable until the pool is empty. No privileges and no special market conditions are required.
Impact: High
The attacker converts borrowed funds into AssetToken shares backed by the liquidity providers' deposits, then redeems them after the loan closes. This is direct theft of the protocol's underlying.
The receiver settles via deposit instead of repay, then redeems the shares minted during the loan.
Against a pool holding 1000e18, with the attacker funding only the 1.5e18 fee:
The attacker spent 1.5 tokenA and took 500.5 tokenA of the liquidity providers' funds.
A balance comparison cannot distinguish money returned as repayment from money paid in for shares, because both land on the same address. The check must confirm the debt was settled through the intended path.
s_currentlyFlashLoaning already tracks an outstanding loan and is simply not consulted by deposit:
Stronger still: have repay credit an explicit per-loan counter and have flashloan require that counter to cover amount + fee, which also closes the related case of plain transfer donations counting as repayment.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.