Open sherlock-admin2 opened 7 months ago
Similar soln as #44 , #48
The protocol team fixed this issue in the following PRs/commits: https://github.com/teller-protocol/teller-protocol-v2-audit-2024/pull/20
I believe this issue, #44 and #48 are duplicates. The root cause of allowing sandwiching via immediate deposit (addPrincipalToCommitmentGroup
) - withdrawals (burnSharesToWithdrawEarnings
) cycles results in 3 impacts:
totalPrincipalTokensCommitted
from deposits. (Sandwich borrowing by front-running with a deposit and then back-running with a withdraw)totalInterestCollected
from deposits (Sandwich repayment/liquidation by front-running with a deposit and then back-running with a withdraw)tokenDifferenceFromLiquidations
decrease from liquidations (Sandwich liquidation by front-running with a withdraw and then back-running with a deposit to reenter)The same fix of a withdrawal delay was applied to all issues.
The Lead Senior Watson signed off on the fix.
0x73696d616f
high
Interest rate in
LenderCommitmentGroup_Smart
may be easily manipulated by depositing, taking a loan and withdrawingSummary
LenderCommitmentGroup_Smart
gets the interest directly from the utilization ratio, which may be gamed and a loan may be taken with lower interest rate at no risk.Vulnerability Detail
The utilization ratio is the ratio between ongoing loans and principal deposited (plus interest and/minus liquidation premiums). As the values used for its calculations are the most recent ones and there is no constraint on depositing, borrowing or withdrawing in different periods, it is easy for borrowers to pick much better interest rates. The attack can be carried out as follows:
LenderCommitmentGroup_Smart::addPrincipalToCommitmentGroup()
.Withdraw the shares corresponding to the borrowed principal. This attack was simulated in the following POC, which should be inserted in the test file in issue 'Drained lender due to LenderCommitmentGroup_Smart::acceptFundsForAcceptBid() _collateralAmount by STANDARD_EXPANSION_FACTOR multiplication':
Impact
Less yield for LPs due to the borrower getting much better interest rates for free.
Code Snippet
LenderCommitmentGroup_Smart::getPoolUtilizationRatio()
Tool used
Manual Review
Vscode
Foundry
Recommendation
LPs could require a small delay to burn their shares to prevent abuses such as this one.