`treasury.updateYieldsFromLiquidatedLrts()` updates the yield in the current chain, but collateral may be in the other chain
The treasury contract updates yield from liquidated collateral in the current chain, but the collateral may be held on another chain. This allows the protocol to withdraw yield that is not backed in the current chain, potentially causing a lack of funds and blocking other withdrawals.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/1052
Found by
0x73696d616f
Summary
treasury.updateYieldsFromLiquidatedLrts() updates the yield from liquidated collateral in the current chain, but this collateral could have been present in the other chain. As such, it will allow the protocol to withdrawal yields that it should not in the current chain, which means other deposited collateral may not be withdrawn due to having been allocated as yield instead.
Root Cause
In CDSLib::667, the treasury is updated with liquidated collateral yield, but this yield may be present in the other chain.
Internal pre-conditions
None.
External pre-conditions
None.
Attack Path
- Borrower is liquidated in chain B.
- Some time passes and a cds depositor in chain A withdraws a part of the collateral, and updates the treasury with yield generated.
- The yield generated is not actually present in chain A, and is in chain B instead, so it will add yield to the treasury that is not actually backed in chain A.
- Protocol withdraws the yield in chain A, which is taken from other borrower deposits, who may not be able to withdraw due to lack of liquidity (or similar).
Impact
Lack of funds in chain A, leading to DoSed withdrawals.
PoC
None.
Mitigation
The yields should always be set in the chain that the liquidation happened and the collateral is held.
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 yield from liquidated collateral is recorded on the wrong chain because the code does not check where the collateral is actually held.
Impact
This could lead to a lack of funds on chain A, potentially causing denial of service for withdrawals.
What the attacker needed
Multi-chain deployment; borrower liquidated on one chain; CDS depositor withdraws on another chain
The fix
The yield should always be recorded on the chain where the liquidation occurred and the collateral is held.
How it was found
- A borrower is liquidated on chain B.
- Later, a CDS depositor on chain A withdraws part of the collateral and updates the treasury with the generated yield.
- The yield is not actually present on chain A but on chain B, so the treasury records unbacked yield on chain A.
- The protocol withdraws the yield on chain A, taking funds from other borrower deposits and potentially causing a lack of liquidity.
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.
This is a cross-chain accounting bug. When a borrower is liquidated on one blockchain, the profit (yield) is recorded on a different blockchain where the collateral isn't actually held. That makes the protocol think it has more money than it really does on that chain, so it can withdraw funds that belong to other users, leaving them unable to get their deposits back.
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.