Late abond holders steal USDa amount from liquidations from earlier abond holders
The redeemYields function credits liquidation gains to abond holders based on the current pro-rata share of the total abond supply, without tracking which holders were present when each liquidation occurred. An attacker could mint abond after a liquidation and then redeem to capture USDa that should have gone to earlier holders.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/817
Found by
0x73696d616f
Summary
BorrowLib::redeemYields() gets usdaToAbondRatioLiq, which is the amount of USDa gained from liquidations pro-rata to the total supply of abond, at current value without consideration from previous depositors. This means that if some user holds abond and a liquidation happens, other users can mint abond to steal yield from past liquidations.
Root Cause
In BorrowLib.sol:1002, there is no consideration from past/next abond holders.
Internal pre-conditions
None.
External pre-conditions
None.
Attack Path
- User deposits and withdraws from
borrowing.sol, minting abond tokens. - User is liquidated via
borrowLiquidation::liquidationType1(), adding USDa from liquidation. - Another user can deposit and withdraw from
borrowing.soland steal these USDa, even using a flashloan if necessary.
Impact
Abond holders suffer losses.
PoC
None.
Mitigation
Add a cumulative tracking variable to handle this case.
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 calculation uses the current pro-rata abond supply at redemption time rather than a cumulative per-holder accounting of liquidation gains.
Impact
Earlier abond holders could lose the liquidation yield owed to them, with the attacker able to fund the position via flashloan.
What the attacker needed
Ability to mint and redeem abond; a prior liquidation adding USDa
The fix
The protocol should track cumulative liquidation gains per holder, for example with a cumulative tracking variable, so only holders present at the time of a liquidation can redeem that yield.
How it was found
- A user deposits and withdraws through borrowing.sol, minting abond tokens.
- That user is liquidated through borrowLiquidation::liquidationType1(), which adds USDa from the liquidation.
- Another user deposits and withdraws through borrowing.sol to claim that USDa, potentially using a flashloan.
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.
Abond is a token that represents a share of a pool, and when the pool earns money from liquidations, holders can redeem their share. The bug is that the payout is calculated from whoever holds tokens at the moment of redemption, not who held them when the money came in. So someone can join the pool late, right before redeeming, and take a slice of earnings that belonged to earlier holders.
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.