-
Notifications
You must be signed in to change notification settings - Fork 6
T1MOH - The submitBid transaction lack of expiration timestamp check #187
Comments
Escalate for 10 USDC |
You've created a valid escalation for 10 USDC! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Escalate for 10 USDC
|
You've created a valid escalation for 10 USDC! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
When creating a loan, the collateral expected to be would be of relatively same value. In the described case where the principal asset has jumped 2x in value, it would become worth more than the given collateral. If the collateral costs less than the principal, the user has no incentive to repay the loan. Therefore, if a case like the described above happens, user could even profit from it as they can just not repay the loan at all. If the principal asset has significantly increased in value, there is no incentive for the lender to accept the loan. |
Agree that it is a low/info issue |
Github PR: Issue 187 - Add deadline to submit bid |
When re-reviewing this issue, I noticed that we actually already have an expiration timestamp check for bids.
So no fix will be done here. |
Escalation accepted Valid low |
|
T1MOH
medium
The submitBid transaction lack of expiration timestamp check
Summary
Submitting bid misses the transaction expiration check, which may lead to receiving principal at a lower price and to collateral being sold at a higher price than the market price at the moment of a
submitBid()
. Borrowers can receive less than expected for provided collateral.Vulnerability Detail
The transaction can be pending in mempool for a long time and can be executed in a long time after the user submit the transaction.
Problem is
submitBid()
, which trusts bid as valid even if market prices of principal and collateral have changed a lot.Impact
It makes borrower to lose money by submitting disadvantageous bid in worse case. And prevents the borrower from making bids that will be valid for a short period of time in best case.
Code Snippet
https://github.com/sherlock-audit/2023-03-teller/blob/main/teller-protocol-v2/packages/contracts/contracts/TellerV2.sol#L334-L368
Tool used
Manual Review
Recommendation
Use deadline mechanism as in Uniswap V2 contract addLiquidity function implementation
https://github.com/Uniswap/v2-periphery/blob/0335e8f7e1bd1e8d8329fd300aea2ef2f36dd19f/contracts/UniswapV2Router02.sol#L61
The text was updated successfully, but these errors were encountered: