updateFlashLoanFee permits a fee of up to 100% of the borrowed valueSeverity: Low · Impact: Low · Likelihood: Low
The flash-loan fee is a fraction scaled by s_feePrecision (1e18); the default is 3e15 (0.3%). A sane upper bound should be well below 100%.
updateFlashLoanFee only rejects values strictly greater than s_feePrecision, so s_flashLoanFee can be set exactly to 1e18 — a 100% fee — which is nonsensical and would make every flash loan cost the full borrowed value.
Likelihood:
Requires the owner to set an unreasonable fee (or fat-finger a value near 1e18). Owner-only, so likelihood is Low, but there is no guardrail against a value that breaks the product.
Impact:
A fee at or near 100% makes flash loans unusable and lets a misconfigured/compromised owner capture the entire borrowed value as fees. Bounded to owner action, so Low.
Save the block below as test/PocL3.t.sol and run forge test --mt test_L3_fee_can_be_set_to_100_percent -vv. updateFlashLoanFee(1e18) is accepted and the fee becomes 100% of the borrowed value.
Bound the fee to a sensible maximum well under 100% (e.g. a few percent), and make the comparison inclusive.
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.