Dandy Caramel Tortoise - Malicious lender can prevent borrower from repayment due to try/catch block revert #39
Labels
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Dandy Caramel Tortoise
High
Malicious lender can prevent borrower from repayment due to try/catch block revert
Summary
Insufficient validation for
try/catch
address will disallow borrower's from repaying their loansRoot Cause
A malicious lender can bypass the
try/catch
block covering the repayLoanCallback external call by selfdestructingloanRepaymentListener
The
try/catch
block will revert if the call is made to a non-contract address. To avoid this a check forcodesize > 0
is kept inside thesetRepaymentListenerForBid
function. But this can be bypassed by the lenderselfdestructing
the_listener
in the same transaction which will delete the contracthttps://github.com/sherlock-audit/2024-11-teller-finance-update/blob/0c8535728f97d37a4052d2a25909d28db886a422/teller-protocol-v2-audit-2024/packages/contracts/contracts/TellerV2.sol#L1287-L1301
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
selfdestruct
itselfImpact
Borrowers will not be able to repay the loan allowing the lender to steal the collateral after the loan will default
PoC
No response
Mitigation
Use .call instead of the try/catch
The text was updated successfully, but these errors were encountered: