Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash - Setting minDebt and minBorrow to low values can cause protocol to accrue bad debt #572

Open
sherlock-admin2 opened this issue Aug 24, 2024 · 9 comments
Labels
Escalation Resolved This issue's escalations have been approved/rejected Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A Medium severity issue. Reward A payout will be made for this issue Sponsor Confirmed The sponsor acknowledged this issue is valid Won't Fix The sponsor confirmed this issue will not be fixed

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Aug 24, 2024

hash

Medium

Setting minDebt and minBorrow to low values can cause protocol to accrue bad debt

Summary

Setting minDebt and minBorrow to low values can cause protocol to accrue bad debt as liquidators won't find enough incentive in clearing the low debt and also depending on the price, users may be able to borrow dust without providing collateral

Vulnerability Detail

minDebt and minBorrow are supposed to be settable from 0

link

Min Debt = from 0 to 0.05 ETH = from 0 to 50000000000000000
Min Borrow = from 0 to 0.05 ETH = from 0 to 50000000000000000

Setting these to low values will allow positions to be created with low debts and liquidations won't happen on small positions due to it not generating enough profit to cover the costs of the liquidator. This will cause the protocol to accure bad debt.
Also if both are set to dust, the roundings will become significant and allows one to borrow dust amounts without proper collateral. Eg, if both are set to 0 and the price of assets is less than that of eth, the borrowing 1 wei of the assets will require no collateral as the value in eth will be rounded to 0

Impact

Protocol can accrue bad debt leading to depositors loosing their assets in case the values are set low

Code Snippet

https://github.com/sherlock-audit/2024-08-sentiment-v2/tree/main?tab=readme-ov-file#q-are-there-any-limitations-on-values-set-by-admins-or-other-roles-in-the-codebase-including-restrictions-on-array-lengths

Tool used

Manual Review

Recommendation

Ensure the minDebt,minBorrow values are not decreased below a certain threshold

@github-actions github-actions bot added Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A Medium severity issue. labels Sep 5, 2024
@sherlock-admin3 sherlock-admin3 added Sponsor Confirmed The sponsor acknowledged this issue is valid Won't Fix The sponsor confirmed this issue will not be fixed labels Sep 11, 2024
@z3s z3s removed the Medium A Medium severity issue. label Sep 15, 2024
@z3s
Copy link
Collaborator

z3s commented Sep 15, 2024

Admin won't set minDebt and/or minBorrow to zero

@z3s z3s closed this as completed Sep 15, 2024
@sherlock-admin4 sherlock-admin4 changed the title Flat Tawny Haddock - Setting minDebt and minBorrow to low values can cause protocol to accrue bad debt hash - Setting minDebt and minBorrow to low values can cause protocol to accrue bad debt Sep 15, 2024
@sherlock-admin4 sherlock-admin4 added Non-Reward This issue will not receive a payout and removed Has Duplicates A valid issue with 1+ other issues describing the same vulnerability labels Sep 15, 2024
@serial-coder
Copy link

I cannot escalate the issue due to insufficient escalation threshold

Hi @z3s,

Your statement is not true:

Admin won't set minDebt and/or minBorrow to zero

Please refer to the following excerpts from the contest public channel.

Furthermore, the "Sponsor Confirmed" tag also confirms that the sponsor considers this issue valid.

Thanks for your time.

@kazantseff
Copy link

Escalate,
per the above comment

@sherlock-admin3
Copy link

Escalate,
per the above comment

You've created a valid escalation!

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.

@cvetanovv
Copy link
Collaborator

I agree with the escalation.

In the Readme, we have values that the TRUSTED admin will set. That is exactly the purpose of this question in the Readme:
https://github.com/sherlock-audit/2024-08-sentiment-v2?tab=readme-ov-file#q-are-there-any-limitations-on-values-set-by-admins-or-other-roles-in-the-codebase-including-restrictions-on-array-lengths

There we can see that the admin will use low values for Min Debt and Min Borrow:

Min Debt = from 0 to 0.05 ETH
Min Borrow = from 0 to 0.05 ETH

If low values are set for minDebt and minBorrow, a liquidator will have no incentive to liquidate the position. This means that the protocol can accrue bad debt.

Planning to accept the escalation and make this issue a Medium severity.

@WangSecurity WangSecurity added Medium A Medium severity issue. and removed Non-Reward This issue will not receive a payout labels Sep 28, 2024
@sherlock-admin2 sherlock-admin2 added Reward A payout will be made for this issue labels Sep 28, 2024
@WangSecurity
Copy link

Result:
Medium
Has duplicates

@WangSecurity WangSecurity reopened this Sep 28, 2024
@sherlock-admin2 sherlock-admin2 removed the Escalated This issue contains a pending escalation label Sep 28, 2024
@sherlock-admin3 sherlock-admin3 added the Escalation Resolved This issue's escalations have been approved/rejected label Sep 28, 2024
@sherlock-admin4
Copy link
Contributor

Escalations have been resolved successfully!

Escalation status:

@AlexCZM
Copy link

AlexCZM commented Oct 8, 2024

Note to @cvetanovv:
#181 is a duplicate. Moreover that issue has a more complete description and I propose to make it the main issue.

@cvetanovv
Copy link
Collaborator

@AlexCZM I agree that #181 is a duplicate of this issue and will duplicate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Escalation Resolved This issue's escalations have been approved/rejected Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A Medium severity issue. Reward A payout will be made for this issue Sponsor Confirmed The sponsor acknowledged this issue is valid Won't Fix The sponsor confirmed this issue will not be fixed
Projects
None yet
Development

No branches or pull requests

9 participants