20,000 USDC
View results
Submission Details
Severity: medium

Unrestricted Loan Repayment

Summary

The repay function allows any user to settle another's loan.

Vulnerability Detail

Without an explicit check, if a user mistakenly repays another's loan, they inadvertently lose tokens loanToken.

File: Lender.sol
IERC20(loan.loanToken).transferFrom(
msg.sender,
address(this),
loan.debt + lenderInterest
);

This design flaw exposes users to unintended financial consequences.

Impact

Users might accidentally repay someone else's loan, leading to unexpected financial losses.

Tools Used

A thorough review of the code base was conducted to identify this issue.

Recommendation

Add the following check:
if (loan.borrower == msg.sender) revert Unauthorized();

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.