Submitted by oakcobalt
In MultiSourceLoan.sol, refinanceFromLoanExecutionData() doesnt check whether _loan.borrower == _loanExecutionData.borrower, which is open rooms for exploits.
BorrowerB (malicious) can sign a _loanExecutionData offer and initiate a refinanceFromLoanExecutionData() call with Borrower As loan. Borrower B will use Borrower As collateral for his loan.
There are (2) vulnerabilities here:
As a result, if _loanExecutionData.borrower (Borrower B) initiates refinanceFromLoanExecutionData() call, the following would happen:
The above steps can also happen in a front-running scenario, where Borrower B sees that Borrower A approves MultiSourceLoan.sol for loan repayments and front-run Borrower As repayment with a new loan.
In _validateExecutionData, consider adding checks to ensure address _borrower == _executionData.borrower.
0xend (Gondi) confirmed
Note: For full discussion, see here.
Gondi mitigated:
Status: Mitigation confirmed. Full details in reports from oakcobalt, minhquanym and bin2chen.
