Skip to content
Business logic Audit finding Intermediate

Type 1 borrower liquidation will incorrectly add cds profit directly to `totalCdsDepositedAmount`

0x73696d616f Follow

Originally disclosed on Sherlock

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

Found by

0x73696d616f

Summary

Borrower liquidations of type 1 add a cds profit component to cds depositors by reducing totalCdsDepositedAmount by a smaller amount of this profit. The problem with this approach is that it will always calculate cumulative values and option fees based on this value, that is bigger than the individual sum of cds depositors, so some values will be left untracked.

Root Cause

In borrowLiquidation.sol:248, omniChainData.totalCdsDepositedAmount is incorrectly reduced by liquidationAmountNeeded - cdsProfits;.

Internal pre-conditions

None.

External pre-conditions

None.

Attack Path

  1. Borrower is liquidated and there is profit.
  2. Profit is added to omniChainData.totalCdsDepositedAmount, which now differs from the individual sum of cds depositors, leading to untracked values, such as the cumulative value from the vault long position or option fees.

Impact

Cumulative value calculations and option fees will be incorrect, as they are divided by a bigger number of cds deposited (which was added the profit), but each cds depositor only has the same deposited amount to multiply by these rates.

PoC

Consider a borrower that deposited 1 ETH at a 1000 USD / ETH price and borrowed 800 USDa. There is 1 cds depositor that deposited 1000 USDa. The price drops 20% and borrowLiquidation::liquidationType1() is called.

  • returnToAbond is (1000 - 800) * 10 / 100 = 20.
  • cdsProfits is 1000 - 800 - 20 = 180.
  • liquidationAmountNeeded is 800 + 20 = 820.
  • cdsAmountToGetFromThisChain is 820 - 180 = 640.
  • omniChainData.totalCdsDepositedAmount is 1000 - (820 - 180) = 360.

Now, every cumulative value or option fee is calculated as if there were 360 USDa deposited as cds depositors, but this is not true, as 820 cds will be liquidated and only 180 is left. The profit should be accounted for, but not in this variable.

Mitigation

Do not add the profit to totalCdsDepositedAmount.

The original report as published on Sherlock, by 0x73696d616f. 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-15).

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 0x73696d616f

View all

172 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.