Auctions fail to account for network and market conditions
The auction mechanism for challenged positions accepts the highest bid even if it is near zero, so under extreme network congestion or market panic, an attacker could win valuable collateral for almost nothing. The report also notes that without any bids, the protocol treats the collateral as worthless and fails to liquidate.
Submitted by 3th
Under certain extreme, but inevitable, network conditions, auctions will not be effective in covering the bad debt of a challenged position. Worse, certain position parameters under these conditions can lead to extremely small bids winning large amounts of collateral. More details follow in the next section, but it should be noted that this same design oversight was responsible for almost destroying Dai in March of 2020—the closest MakerDAO has ever been to utilizing its emergency shutdown module.
Proof of Concept
When the Ethereum network becomes highly congested, the price of gas can skyrocket to incredible levels. During times like these, users of the network will limit their activity to only the most urgent matters—in the case of March 12th, 2020, for example, the only people paying the exorbitant network fees were rushing to exit their positions as the price of ETH (and everything else) began to free fall.
On that day, MakerDAO’s collateral auctions were slipping by unnoticed, as the bots that would typically compete in the majority of these auctions saw failing transactions, hit cost limits defined by their owners, or were simply deactivated. An attacker noticed them, however, and began winning auctions on liquidated collateral with bids of zero ETH.
This exact vulnerability exists in the Frankencoin system, and it can be exploited under exactly the same circumstances. If a challenge only has a single bid when the challenge period ends, and that bid is near zero, the bid will still win the collateral regardless of how much it is actually worth.
At first glance, Frankencoin developers might be tempted to believe that the dynamic challenge period on its positions will allow for the system to rely primarily on auctions that can outlast abnormally volatile days. In practice, however, this is unlikely to be true, since “safe” positions will likely end up with very short challenge periods. This is unavoidable, because the vast majority of ZCHF will be backed by these types of collateral, and the system risks carrying untenable amounts of bad debt ever more the longer these challenge periods are extended. And extending these windows does not actually solve the problem anyways, since the bad debt cannot be covered until they end.
Consider, as well, that Frankencoin has a significant additional barrier to liquidating its positions when compared with MakerDAO: challenging requires collateral. I’ll actually discuss this piece of the challenge design in more detail in a separate report, but it bears mentioning that such a requirement will only make it less likely that positions will be challenged under extreme network and market conditions in the first place. If huge swaths of positions against a highly trusted collateral type all violate their liquidation prices concurrently, the amount of capital required to challenge all unsafe positions at once is unlikely to materialize quickly. This will lead to a severe loss of confidence in the ZCHF peg, as the system’s bad debt balloons, auctions clear for pennies on the dollar, and large, undercollateralized positions remain unchallenged. The peg likely could not withstand the ZCHF panic selling that would doubtlessly occur alongside this.
In fact, this vulnerability does not even require a malicious actor to make the protocol insolvent in market conditions such as these. Since a challenge with no bids will determine the collateral to be worthless, the protocol will fail to liquidate any collateral from some or all of its unsafe positions.
Recommended Mitigation Steps
Since the high barrier to challenging positions is better covered in another report, its mitigation will be discussed there as well.
For the greater underlying problem in this report, the mitigation is actually relatively simple: the auctions should be converted to “dutch auctions.” This simply means that, rather than starting from zero and accepting the highest bid, the auction should start above the liquidation price and gradually decrease. This will prevent any challenges from ending with winning near-zero bids.
Under certain extreme, but inevitable, network conditions, auctions will not be effective in covering the bad debt of a challenged position
The main function of challenges here is to prevent positions with wrong pricing from being minted, but will leave open for sponsor’s comment since in some cases a low bid can cause loss to the protocol.
luziusmeisser (Frankencoin) disagreed with severity and commented:
Very interesting input.
However, I’m not convinced that a Dutch auction would always be preferrable. One of the strength of the FRankencoin system is that its auction mechanism can handle relatively exotic collaterals. For those, it might take a few days for the bidders to evaluate them or to organize the bid. If the price falls too low during that time, the challenge might be successful even though the market price is above the liquidation price…
I would acknowledge this issue as medium severity.
hansfriese (judge) decreased severity to Medium
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
Root cause
Likely the auction design accepts the highest bid without a minimum price, so a near-zero bid can win the collateral.
Impact
Under extreme network and market conditions, an attacker could win large amounts of collateral with near-zero bids, and the protocol could fail to cover bad debt, potentially leading to insolvency and loss of confidence in the stablecoin peg.
What the attacker needed
Extreme network congestion or market panic; few or no competing bidders; attacker can submit a near-zero bid
The fix
The report recommends converting the auctions to Dutch auctions, starting above the liquidation price and gradually decreasing, to prevent near-zero winning bids.
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, when a position is challenged, its collateral is sold to the highest bidder. The problem is that if only one person bids a tiny amount, they still get all the collateral, even if it is worth much more. This can happen when the network is busy and normal bidders stay away, letting an attacker buy valuable assets very cheaply.
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.