Epochs can be progressed during ongoing auctions to cause LP fund loss and collateral lockup
The `finalAuctionEnd` variable is set to a fixed duration (3 days) instead of an actual timestamp, so the check for auction end is incorrect. This allows epochs to be progressed during an ongoing auction, which can disrupt liquidation logic and potentially cause loss of LP funds and locked collateral.
Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/175
Found by
0xRajeev
Summary
The currentEpoch can be progressed while having an ongoing auction which will completely mess up the liquidation logic to potentially cause LP fund loss and collateral lockup.
Vulnerability Detail
The LiquidationAccountant.claim() function is only callable if finalAuctionEnd is set to 0 or the block.timestamp is greater than finalAuctionEnd (i.e. auction has ended). Furthermore, PublicVault.processEpoch should only be callable if there is no ongoing auction if a liquidation accountant is deployed in the current epoch.
finalAuctionEnd is set within the LiquidationAccountant.handleNewLiquidation function, which is called from the AstariaRouter.liquidate function. However, instead of providing a timestamp of the auction end, a value of 2 days + 1 days is given because COLLATERAL_TOKEN.auctionWindow() returns 2 days.
This does not achieve the intended constraint on checking for the end of the auction because it uses a fixed duration instead of a timestamp.
Impact
Epochs can be progressed during ongoing auctions to completely mess up the liquidation logic to potentially cause LP fund loss and collateral lockup.
Code Snippet
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/LiquidationAccountant.sol#L67
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/PublicVault.sol#L244-L248
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/AstariaRouter.sol#L409
Tool used
Manual Review
Recommendation
Revisit the logic to use an appropriate timestamp instead of a fixed duration.
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 code sets `finalAuctionEnd` to a duration (2 days + 1 day) rather than a timestamp, so the check for auction end is ineffective.
What the attacker needed
An ongoing auction; liquidation accountant deployed
The fix
The logic should be revised to use an appropriate timestamp instead of a fixed duration.
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 smart contract system, when a loan is liquidated, an auction is started to sell the collateral. The code is supposed to prevent certain actions (like moving to a new epoch) until the auction ends. However, it mistakenly uses a fixed time period (3 days) instead of the actual end time of the auction. This means the system might think the auction has ended when it hasn't, allowing actions that can mess up the funds and lock collateral.
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.