Skip to content
Business logic Audit finding Intermediate

Missing Update to `omnichain.totalAvailableLiquidationAmount` in `withdrawUser`

0x37 Follow with 0x73696d616f, Cybrid and 2 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/930

Found by

0x37, 0x73696d616f, Cybrid, Waydou, volodya

Summary

In the deposit function we update omnichain.totalAvailableLiquidationAmount based on the enw deposit, however The Withdraw function processes user withdrawals but fails to update the omnichain.totalAvailableLiquidationAmount. This omission creates a discrepancy between the protocol's actual liquidation capacity and the recorded available amount. While the deposit function correctly adjusts this value, the absence of an update during withdrawals leads to an inflated totalAvailableLiquidationAmount, potentially allowing the protocol to overcommit its liquidation resources.

Root Cause

  1. The withdrawUser function processes user withdrawals without adjusting the omnichain.totalAvailableLiquidationAmount to reflect the reduced CDS pool.
  2. The deposit function, in contrast, correctly updates this value when users contribute to the CDS pool.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

  1. A user withdraws their CDS funds, but the protocol does not update omnichain.totalAvailableLiquidationAmount.
  2. During liquidation, the protocol calculates user shares based on the inflated value.
  3. The overestimated totalAvailableLiquidationAmount causes some liquidation gains to remain undistributed, locking funds in the protocol.

Impact

  1. A portion of liquidation gains remains locked in the CDS pool, reducing the funds distributed to eligible users.
  2. Remaining CDS participants receive a smaller share of the liquidation gains than they are entitled to.

PoC

  1. State Before Withdrawal:
  • omnichain.totalAvailableLiquidationAmount = 1,000,000 USDa.
  • User withdraws 200,000 USDa.
  1. Expected Behavior:
  • omnichain.totalAvailableLiquidationAmount is reduced to 800,000 USDa.
  1. Actual Behavior:
  • omnichain.totalAvailableLiquidationAmount remains 1,000,000 USDa.
  1. During Liquidation:
  • Assume liquidation generates 500,000 USDa in gains.
  • Share calculation uses the inflated 1,000,000 USDa instead of the actual 800,000 USDa.
  • 100,000 USDa of the gains remains locked due to the overestimated pool size.

Mitigation

JavaScript
params.omniChainData.totalAvailableLiquidationAmount -= params.cdsDepositDetails.withdrawedAmount;

I should note there seems to be no update on omnichain, this should be looked at

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity business logic bug in Autonomint Colored Dollar V1. Sherlock made it public on 19 January 2025. Found in the 569 audit contest (finding H-28), also found by 4 other wardens.

About Business logic

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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 by 0x37

View all

79 more disclosed reports, best first.

More from Autonomint Colored Dollar V1

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.