As it is stated, the MAX_INIT_BORROWING_FEE = 0.05e18, denoting the max allowed to be set as borrowing fee. Unfortunately, the owner cannot set the borrowing fee to max
There is a mistake in the logic of this Line, the check uses ">=".The implication of this is that the Owner can't set the borrowing fee to the MAX_INIT_BORROWING_FEE of which is not an intended behavior of the protocol.
Instead it should be made to revert only when the _newBorrowingFee exceeds the MAX_INIT_BORROWING_FEE
Tools Used
Manual Review
Recommended Mitigation Steps
Change the line to if (_newBorrowingFee > MAX_INIT_BORROWING_FEE) revert VaultController_FeeTooLarge();
Lines of code
https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L426
Vulnerability details
Impact
As it is stated, the MAX_INIT_BORROWING_FEE = 0.05e18, denoting the max allowed to be set as borrowing fee. Unfortunately, the owner cannot set the borrowing fee to max
Proof of Concept
https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L426
There is a mistake in the logic of this Line, the check uses ">=".The implication of this is that the Owner can't set the borrowing fee to the MAX_INIT_BORROWING_FEE of which is not an intended behavior of the protocol.
Instead it should be made to revert only when the _newBorrowingFee exceeds the MAX_INIT_BORROWING_FEE
Tools Used
Manual Review
Recommended Mitigation Steps
Change the line to if (_newBorrowingFee > MAX_INIT_BORROWING_FEE) revert VaultController_FeeTooLarge();
Assessed type
Other