Users can be griefed due to lack of minimum size within the Loan and Offer
The protocol lacked a minimum size for loans and offers, allowing a malicious aggregator to split a user's borrow offer into many tiny loans and offers. This could overwhelm the user and force them to pay excessive gas to manage or claim their funds.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-10-debita-judging/issues/557
Found by
xiaoming90
Summary
No response
Root Cause
No response
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
Assume that Bob creates a borrow offer with 10000 AERO as collateral to borrow 10000 USDC at the price/ratio of 1 AERO:1 USDC for simplicity's sake.
Malicious aggregator (aggregator is a public role and anyone can match orders) can perform griefing attacks against Bob.
The malicious aggregator can create many individual loans OR many loans with many offers within it, OR a combination of both. Each loan and offer will be small or tiny and consist of Bob's borrow order. This can be done because the protocol does not enforce any restriction on the minimum size of the loan or offer.
As a result, Bob's borrow offer could be broken down into countless (e.g., thousands or millions) of loans and offers. As a result, Bob will not be able to keep track of all the loans and offers belonging to him and will have issues paying the debt or claiming collateral.
This issue is also relevant to the lenders, and the impact is even more serious as lenders have to perform more actions against loans and offers, such as claiming debt, claiming interest, claiming collateral, or auctioning off defaulted collateral etc.
In addition, it also requires lenders and borrowers to pay a significant amount of gas fees in order to carry out the actions mentioned previously.
As a result, this effectively allows malicious aggregators to grief lenders and borrowers.
Impact
Malicious aggregators to grief lenders and borrowers.
PoC
No response
Mitigation
Having a maximum number of offers (e.g., 100) within a single Loan is insufficient to guard against this attack because malicious aggregators can simply work around this restriction by creating more loans.
Thus, it is recommended to impose the minimum size for each loan and/or offer, so that malicious aggregators cannot create many small/tiny loans and offers to grief the users.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/DebitaFinance/Debita-V3-Contracts/commit/c7567f5dbd9d8e224e6e3a684cc396a3829775e1
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Malicious aggregators could grief lenders and borrowers, causing them difficulty in managing loans and requiring significant gas fees.
What the attacker needed
Attacker can act as an aggregator; victim has an active borrow or lend offer
The fix
The protocol team fixed this issue by imposing a minimum size for each loan and/or offer.
How it was found
- Bob creates a borrow offer with 10000 AERO as collateral to borrow 10000 USDC.
- A malicious aggregator creates many individual loans or many loans with many offers, each tiny, using Bob's borrow order.
- Bob's borrow offer is broken down into countless loans and offers, making it hard for him to manage and pay debt or claim collateral.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In this system, users can create offers to borrow or lend tokens, and other users (aggregators) match these offers. Because there was no minimum amount for a loan or offer, an attacker could break one large offer into thousands of tiny ones. This makes it very hard and expensive for the original user to keep track of and manage their loans.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.