Someone can create non-liquidatable auction if the collateral asset fails on transferring to address(0)
The auction function allows the auctioneer address to be set to address(0), and when the auctioneer reward is paid out, the token transfer to address(0) reverts on some tokens, making the auction impossible to liquidate. A malicious user could start an auction on their own underwater vault with a zero auctioneer to avoid liquidation and force the protocol to take on bad debt.
Submitted by antonttc, also found by 0x52
Might lead to systematic debt. Cause errors for liquidators to run normally.
Proof of Concept
In the function auction, there is an input validation around whether the to is address(0) or not. And if the auctioneerReward is set to an value > 0 (as default), each liquidate call will call Join module to pay out to auctioneer with the following line:
if (auctioneerCut > 0) {
ilkJoin.exit(auction_.auctioneer, auctioneerCut.u128());
}
This line will revert if auctioneer is set to address(0) on some tokens (revert on transferring to address(0) is a default behaviour of the OpenZeppelin template). So if someone start an auction with to = address(0), this auction becomes un-liquidatable.
A malicious user can run a bot to monitor his own vault, and if they got underwater and they don’t have enough collateral to top up, they can immediately start an auction on their own vault and set actioneer to 0 to avoid actually being liquidated, which breaks the design of the system.
Recommended Mitigation Steps
Add check while starting an auction:
function auction(bytes12 vaultId, address to)
external
returns (DataTypes.Auction memory auction_)
{
require (to != address(0), "invalid auctioneer");
...
}
alcueca (Yield) confirmed and commented:
Best finding of the contest
Most critical vulnerability found during the audit since a malicious user could open a vault and never get liquidated, it would force the protocol to take on bad debts. The warden did a great job of describing the issue and providing the sponsor with a detailed fix.
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
The auction function lacks a check that the auctioneer address is not address(0), and the reward payout to that address reverts on tokens that reject transfers to address(0).
Impact
A malicious user could avoid liquidation of their underwater vault, potentially forcing the protocol to take on bad debt; the issue only occurs on tokens that revert on transfers to address(0).
What the attacker needed
A vault with collateral; the collateral token reverts on transfer to address(0); the auctioneer reward is greater than zero
The fix
The auction function should require that the auctioneer address is not address(0).
How it was found
- A user opens a vault and later it becomes underwater.
- The user starts an auction on their own vault with the auctioneer set to address(0).
- When a liquidator tries to liquidate, the reward payout to address(0) reverts on tokens that reject such transfers.
- The auction cannot be completed, so the vault is never liquidated.
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.
When a borrower's collateral is worth less than their debt, the system lets others liquidate the vault by starting an auction. The auction code pays a small reward to the person who starts it, but it does not check that the reward address is valid. If that address is the special zero address, some tokens refuse to send funds there, so the auction always fails and the vault can never be liquidated.
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.