This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
0x52 - Malicious users can donate/leave dust amounts of collateral in contract during auctions to buy other collateral at very low prices #168
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid 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
0x52
medium
Malicious users can donate/leave dust amounts of collateral in contract during auctions to buy other collateral at very low prices
Summary
Auctions are only ended early if the amount of the token being auctioned drops to 0. This can be exploited via donation or leaving dust in the contract to malicious extend the auction and buy further liquidate collateral at heavily discounted prices.
Vulnerability Detail
InsuranceFund.sol#L184-L199
When buying collateral from an auction, the auction is only closed if the balance of the token is 0. This can be exploited in a few ways to maliciously extend auctions and keep the timer (and price) decreasing. The first would be buy all but 1 wei of a token leaving it in the contract so the auction won't close. Since 1 wei isn't worth the gas costs to buy, there would be a negative incentive to buy the collateral, likely resulting in no on buying the final amount. A second approach would be to frontrun an buys with a single wei transfer with the same results.
Now that the auction has been extended any additional collateral added during the duration of the auction will start immediately well below the assets actual value. This allows malicious users to buy the asset for much cheaper, causing loss to the insurance fund.
Impact
Users can maliciously extend auctions and potentially get collateral for very cheap
Code Snippet
InsuranceFund.sol#L184-L199
Tool used
Manual Review
Recommendation
Close the auction if there is less than a certain threshold of a token remaining after it has been bought:
The text was updated successfully, but these errors were encountered: