There is a maxTranches limit in Loan contract. However it is only checked in addNewTranche() but not in other flows. For example, a loan could be opened with already more tranches than maxTranches
Mitigation
The fix added the missing check for maxTranches for all flows that might add tranches. The check is added to _validateExecutionFlow() which is a shared functions between those flows.
if (block.timestamp > _executionData.executionData.expirationTime) {
revert ExpiredOfferError(_executionData.executionData.expirationTime);
}
+ if (_executionData.executionData.offerExecution.length > getMaxTranches) {
+ revert TooManyTranchesError();
+ }
Lines of code
Vulnerability details
Issue
There is a
maxTranches
limit in Loan contract. However it is only checked inaddNewTranche()
but not in other flows. For example, a loan could be opened with already more tranches thanmaxTranches
Mitigation
The fix added the missing check for
maxTranches
for all flows that might add tranches. The check is added to_validateExecutionFlow()
which is a shared functions between those flows.