Uninitialized or Incorrectly set auctionInterval may lead to liquidation engine livelock
The auctionInterval state variable in the Cauldron contract is uninitialized and defaults to zero, and its setter does not validate the value. An attacker could repeatedly call grab to prevent auction prices from dropping, causing a livelock where liquidation engines keep re-grabbing vaults without progress.
Yield Witch v2 contest
Originally disclosed on Code4rena
The grab() function in Cauldron is used by the Witch or other liquidation engines to grab vaults that are under-collateralized. To prevent re-grabbing without sufficient time for auctioning collateral/debt, the logic uses an auctionInterval threshold to give a reasonable window to a liquidation engine that has grabbed the vault.
The grab() function has a comment on Line 354: ”// Grabbing a vault protects it for a day from being grabbed by another liquidator. All grabbed vaults will be suddenly released on the 7th of February 2106, at 06:28:16 GMT. I can live with that.” indicating a requirement of the auctionInterval being equal to one day. This can happen only if the auctionInterval is set appropriately. However, this state variable is uninitialized (defaults to 0) and depends on setAuctionInterval() being called with the appropriate auctionInterval_ value, which is also not validated.
Discussion with the project lead indicated that this comment is incorrect. Nevertheless, it is safer to initialize auctionInterval at declaration to a safe default value instead of the current 0, which will allow liquidation engines to re-grab vaults without making any progress on liquidation auction. It is also good to add a threshold check-in setAuctionInterval() to ensure the new value meets/exceeds a reasonable default value.
The rationale for Medium-severity impact: While the likelihood of this may be low, the impact is high because liquidation engines will keep re-grabbing vaults from each other and potentially result in liquidation bots entering a live-lock situation without making any progress on liquidation auctions. This will result in collateral being stuck and impact the entire protocol’s functioning. So, with low likelihood and high impact, the severity (according to OWASP) is medium.
See Issue page for proof of concept and referenced code.
Recommend:
- Initialize
auctionIntervalat declaration with a reasonable default value. - Add a threshold check in
setAuctionInterval()to ensure the new value meets/exceeds a reasonable default value.
albertocuestacanada (Yield) confirmed but disagreed with severity:
While we support multiple liquidation engines, we are going live with only one, and only one is in the scope of the contest.
Zero is an acceptable value for
auctionIntervalusing just one liquidation engine (the Witch). The issue can be solved with better natspec and better documentation; therefore, a severity of 0 is suggested.
albertocuestacanada (Yield) commented:
Actually, if we forget to set
auctionIntervalto a reasonable value, an attacker could repeatedly callgrabwith just one Witch, stopping auctions from dropping down in price until an emergency governance action is taken.Therefore, I would suggest the severity be reduced to 1 instead of zero.
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
Impact
An attacker could repeatedly call grab to stop auctions from dropping in price, potentially causing a livelock and stuck collateral, though the project noted only one liquidation engine is in scope and zero may be acceptable with a single engine.
What the attacker needed
AuctionInterval remains zero; attacker can call grab repeatedly
The fix
The auctionInterval should be initialized at declaration with a reasonable default and setAuctionInterval() should enforce a minimum threshold.
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 a lending protocol, when a vault becomes under-collateralized, a liquidator can 'grab' it to start an auction. To stop others from immediately taking it back, the contract waits for a set time (auctionInterval) before allowing another grab. Here that time was never set, so it was zero, meaning anyone could grab the same vault over and over, blocking the auction from ever finishing.
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.