setFlashLoanFee() lacks input validation #78
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-139
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2022-10-traderjoe/blob/main/src/LBFactory.sol#L474
Vulnerability details
Impact
Owner could deny users from using flash loans.
Proof of Concept
_flashLoanFee is not checked here, so it can be set to any value by a malicious owner.
When a user attempts to call flashLoan() from LBPair.sol the following function is called:
If _fee is large, this function will revert, which will prevent a user from using flash loan functionality.
Tools Used
vim
Recommended Mitigation Steps
Add upper and lower bounds checks.
The text was updated successfully, but these errors were encountered: