Cds depositors profit up to the strike price is not redeemable as the total cds deposited amount is not increased
The profit earned by CDS depositors when the ETH price rises up to the strike price is not added to the total CDS deposited amount. As a result, CDS depositors cannot withdraw this profit because the withdrawal would underflow.
0x73696d616f Follow with John44
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/743
Found by
0x73696d616f, John44
Summary
Cds depositors get the profit on the eth price increase up to the strike price (5%), and any increase above this threshold goes to the borrowers. However, this amount is never added to the total cds deposited amount, which means that cds depositors can not actually withdraw it as it would underflow.
Root Cause
In borrowing.sol:667/667, the upside is not added to omniChainData.totalCdsDepositedAmount.
Internal pre-conditions
None.
External pre-conditions
None.
Attack Path
- Price increase of a borrower deposit, who withdraws.
- The upside is not added to the total cds deposited amount, so the cds depositors can not withdraw this profit or it underflows.
Impact
Cds depositors upside is not withdrawable and will underflow.
PoC
Here the upside is not added to the total cds deposited amount, which means that it will underflow when cds depositors withdraw the profit here. The profit is added here.
Mitigation
Add the upside to omniChainData.totalCdsDepositedAmount.
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 upside profit is not added to the total CDS deposited amount when a borrower withdraws after a price increase.
Impact
CDS depositors' upside profit is not withdrawable and will underflow.
What the attacker needed
A borrower deposit with price increase; borrower withdraws
The fix
The upside should be added to `omniChainData.totalCdsDepositedAmount`.
How it was found
- A borrower's deposit increases in price and the borrower withdraws.
- The upside profit is not added to the total CDS deposited amount.
- CDS depositors try to withdraw the profit but the transaction underflows.
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, people who deposit into a 'CDS' pool earn a share of profits when the price of ETH goes up, but only up to a certain limit. The code forgets to update a running total that tracks how much is in the pool, so when someone tries to take out their profit, the system thinks there is not enough money and blocks the withdrawal.
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.