The Lender::refinance()
subtracts the new pool's balance twice, resulting in removing the loanToken
amount permanently.
The refinance()
subtracts the new pool's balance twice in L636 and L698. Subsequently, the new pool's loanToken
amount will be removed permanently. The pool's lender (owner) or even the protocol admin will not be able to retrieve the removed amount.
1st balance subtraction
: https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L636
2nd balance subtraction
: https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L698
Every time the refinance()
is executed, the new pool's loanToken
amount will be removed permanently. This vulnerability can affect every pool regardless of what kind of loanToken
is. Hence, I consider this vulnerability a high-risk issue.
Manual Review
I recommend removing the 2nd balance subtraction.
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.