Skip to content
Business logic Audit finding Intermediate

Absence of autonomous mechanism for selling collateral assets in the external market in exchange for USDS will cause undercollateralization during market crashes and will cause USDS to depeg

The protocol lacks an autonomous mechanism to sell collateral assets for USDS on the external market during a market crash, so collateral value can fall below the minted USDS supply, causing undercollateralization and depegging. This could cause financial loss to USDS holders and threaten the protocol's existence.

0xGreyWolf Follow with Toshii, 0x3b and 2 others

Originally disclosed on Code4rena

Submitted by 0xGreyWolf, also found by Toshii, 0x3b, BiasedMerc, and klau5

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/Upkeep.sol#L244

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L140

  • The stablecoin USDS retains its US dollar peg by being overcollateralized. That is true on a bull market. That is also true on a bear market if the liquidation process is faster than the falling prices of the collateral assets.
  • However during a bear market, there is a scenario where the the price of collateral assets may tank faster than the liquidation process. In this scenario, the total value of the collateral assets of the protocol may end up being lower than the minted / circulating USDS. This will cause undercollateralization and will cause the USDS to depeg.
  • The depegging will cause the holders of USDS to lose financially. It may cause panic and that will be an existential threat to the protocol.

Recommended Mitigation Steps

  • Create a function to sell assets and acquire USDS on external market and just like liquidateUser() and performUpkeep(), reward the users for doing it (calling the function).
  • If USDS is not available, buy stablecoins USDC and store it for a while to serve as an emergency collateral backing until the market goes back to normal.

othernet-global (Salty.IO) acknowledged and commented:

Note: the overcollateralized stablecoin mechanism has been removed from the DEX.

https://github.com/othernet-global/salty-io/commit/f3ff64a21449feb60a60c0d60721cfe2c24151c1

Note: the overcollateralized stablecoin mechanism has been removed from the DEX.

https://github.com/othernet-global/salty-io/commit/f3ff64a21449feb60a60c0d60721cfe2c24151c1

Picodes (Judge) decreased severity to Medium and commented:

Regrouping as duplicates of this issue reports about the fact that the swaps are not atomic so the protocol holds a temporary change risk.

othernet-global (Salty.IO) commented:

The stablecoin framework: /stablecoin, /price_feed, WBTC/WETH collateral, PriceAggregator, price feeds and USDS have been removed: https://github.com/othernet-global/salty-io/commit/88b7fd1f3f5e037a155424a85275efd79f3e9bf9

Status: Mitigation confirmed. Full details in reports from zzebra83, 0xpiken, and [t0x1c].


The original report as published on Code4rena, by 0xGreyWolf. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

During a rapid market crash, the protocol could become undercollateralized, causing USDS to depeg and holders to lose money, potentially threatening the protocol's existence.

What the attacker needed

Rapid market crash; collateral prices fall faster than liquidations

The fix

The overcollateralized stablecoin mechanism was removed from the DEX, and the stablecoin framework, price feeds and USDS were removed.

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.

A stablecoin tries to stay worth one dollar by holding more valuable assets (collateral) than the coins it has issued. If those assets lose value very quickly, the total backing can become less than the coins in circulation, so the coin may no longer be worth a dollar. This report says the system has no automatic way to sell collateral for its own stablecoin to defend the peg during a crash.

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.

More from Salty.IO

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.