Closed howlbot-integration[bot] closed 1 month ago
If the originationFeeAmount is zero, there's no fee to pay - fees aren't required for every template. The protocol fee: can also be zero; is on the interest not a flat token amount; can be updated.
Invalidating - intended behavior
3docSec marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/HooksFactory.sol#L153-L170
Vulnerability details
Proof of Concept
In the wildcat protocol the archController adds a hook template with some key parameters
address hooksTemplate,string calldata name, address feeRecipient,address originationFeeAsset, uint80 originationFeeAmount, uint16 protocolFeeBips
, on functionHooksFactory::addHooksTemplate
, the function_validateFees
does the validition of fees without a proper validation check onoriginationFeeAmount
andprotocolFeeBips
. When an ArchController inputsoriginationFeeAmount
equal to 0 it will not revert.Leading to a hook template deployed with an originationFeeAmount of 0. That is when it becomes tricky since the borrower can now deploy a market without paying an originationFee in theHooksFactory::deployMarket
function .Proof Of Code
Impact
The borrower will deploy a market without paying any
originationFeeAmount
andprotocolFeeBips
leading to a loss of funds for the protocol.Tools Used
Manual Review.
Recommended Mitigation Steps
Ensure that theres is a check on
originationFeeAmount
andprotocolFeeBips
that they are not equal to to 0 else they should revert.Assessed type
Invalid Validation