Submitted by rvierdiiev
https://github.com/debtdao/Line-of-Credit/blob/audit/code4rena-2022-11-03/contracts/modules/credit/LineOfCredit.sol#L223-L244
https://github.com/debtdao/Line-of-Credit/blob/audit/code4rena-2022-11-03/contracts/utils/LineLib.sol#L59-L74
Borrower can mistakenly add own money to credit if credit is in ETH.
Function LineOfCredit.addCredit is used to create new credit.
It can be called only after contest of another party.
LineLib.receiveTokenOrETH(token, lender, amount) is responsible for getting payment.
https://github.com/debtdao/Line-of-Credit/blob/audit/code4rena-2022-11-03/contracts/utils/LineLib.sol#L59-L74
As you can see in case of native token payment, sender is not checked to be msg.sender, so this makes its possible that borrower can mistakenly pay instead of lender. It sounds funny, but its possible. What is needed is for the lender to call addCredit first and then borrower calls addCredit and provides value.
VSCode
Check that if payment in ETH, then lender == msg.sender in addCredit function.
kibagateaux (Debt DAO) confirmed
