The owner of the ThunderLoan contract can set the allowed tokens, update the flash loan fee, and upgrade the contract implementation. These capabilities could be performed with malicious intent.
The ThunderLoan contract inherits from OpenZeppelin's Ownable contract meaning that it has an owner: the address which has permissions to call functions with the onlyOwner modifier. These functions include:
ThunderLoan::setAllowedToken:
ThunderLoan::updateFlashLoanFee:
Upgrade the contract implementation via UUPSUpgradeable::updateAndCall which calls ThunderLoan::_authorizeUpgrade:
This owner is centralized and therefore users have to trust that the owner will not take advantage of these privileges and perform malicious upgrades, inflate the fee price, or add tokens which are a vulnerability risk.
If the owner address' private key is stolen by an attacker or the owner has malicious intentions, the users of the contract are vulnerable to malicious attacks resulting from the ability of the owner to:
Inflate the s_flashLoanFee to an arbitrarily large value. This would inflate the fee to be arbitrarily large meaning that users will have to pay significantly for even small loans.
Upgrade the contract implementation to any logic of their choosing. This could include malicious examples such as sending all of the liquidity providers' tokens to themselves by calling ThunderLoan::redeem or ThunderLoan::deposit.
The likelihood of the owner being a malicious actor or their private key being stolen is of medium likelihood but the impact is high. This makes this vulnerability a medium-severity vulnerability.
The possible ways to mitigate this vulnerability are:
Use a multisig
Use a two-stage upgrade process
Prevent upgrades all-together
Warn users and clearly document the privileges and the implementation logic so that users are aware of the risks.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.