The 'transferFrom' function is being called without checking whether the p.lender address has approved the Lender contract to spend tokens on its behalf
The vulnerability allows unauthorized token transfers from the p.lender address, leading to potential loss of funds for the user and exposing them to financial risks if exploited.
Slither
Could look something like this; if (p.poolBalance > currentBalance) {
// Ensure that the Lender contract is allowed to transfer tokens from p.lender
uint256 transferAmount = p.poolBalance - currentBalance;
require(
IERC20(p.loanToken).allowance(p.lender, address(this)) >= transferAmount,
"Lender not authorized to transfer tokens"
);
OR
if (p.poolBalance > currentBalance) {
// Ensure that the Lender contract is allowed to transfer tokens from p.lender
uint256 transferAmount = p.poolBalance - currentBalance;
require(
IERC20(p.loanToken).allowance(p.lender, address(this)) >= transferAmount,
ERR_NOT_AUTHORIZED
);
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.