Skip to content
Business logic Audit finding Intermediate

Publisher can lock all user funds in the Basket in order to force a user to have their bond burned

The publisher of a Basket can set the minimum auction ratio to the maximum value, preventing any auction bids from succeeding and locking the basket in auction state. Users cannot enter or exit while an auction is ongoing, so they are forced to burn a bond to reset the auction and withdraw, losing 0.25% of the basket token supply.

TomFrenchBlockchain Follow

Originally disclosed on Code4rena

Submitted by TomFrenchBlockchain, also found by WatchPug

All user funds in a basket being held hostage by the publisher

Proof of Concept

The Basket publisher can propose an auction in order to set new tokens and weights with a 1 day timelock.

Basket.sol#L216-L244

As part of this call they can set the minIbRatio variable which determines what the maximum slippage on the auction is allowed to be. If it’s set to the current IbRatio then the Basket accepts no slippage.

The publisher can choose to set minIbRatio = type(uint256).max which will prevent any auction bids from being successful, locking the basket in the auction state.

It’s not possible to enter or exit the basket while an auction is going on, so any users who hold any funds in the basket are forced to take the only option to kill the auction available to them.

Basket.sol#L91-L119

If a user makes a bond and then waits a day to then call Auction.bondBurn, it will reset the auction and allow users to withdraw but it requires 0.25% of the supply of the basket token to be burned.

Auction.sol#L121-L134

One of the basket’s users is then forced to give up some of their assets to secure the release of the remaining assets in the basket (for a 24hr period until the publisher starts a new auction).

This attack can be launched at any time with only 24 hours warning. This is a very short amount of time which near guarantees that if other users hold funds in the basket that not all of them will successfully withdraw in that time and so will have funds locked.

Recommended Mitigation Steps

Again this is tricky to mitigate as there are legitimate scenarios where we would expect the ibRatio to increase. e.g. a basket containing WBTC being changed to contain USDC as each basket token should be worth much more USDC than it was in terms of WBTC.

To be frank the entire auction mechanism is a bit shaky as it doesn’t account for changes in the values of the tokens over time.

frank-beard (Kuiper) acknowledged, but disagreed with High severity and commented:

This is where community action and the timelock should mitigate attacks of these types. Users should be able to hold publishers accountable for their rebalances, whether that is through a dao or other means. We acknowledge there is some level of trust required between the user and the publisher however this is also intentional, for the types of products this protocol is for.

0xleastwood (judge) decreased severity to Medium and commented:

Because a timelock is used in this instance, exploiting this issue proves more difficult and requires that the publisher is malicious. As we are dealing with an abuse of privileges, I think this fits the criteria of a medium severity issue as the issue can only be exploited by a trusted account.

0xleastwood (judge) commented:

Actually I’m not sure if I understand the exploit:

  • The publisher must wait a day to call Basket.publishNewIndex(), setting new values and starting an auction. In that time, users are free to exit the protocol as they wish.
  • However, users who were not able to exit in time are obligated to call Auction.bondForRebalance() in order to unlock the basket’s underlying assets. But because Auction.settleAuction() will always revert, this user forfeits their bond to unlock the rest of their tokens.

In this case, I see this as an abuse of the publisher’s privileges and lack of oversight by the users. medium severity seems correct in this situation.


The original report as published on Code4rena, by TomFrenchBlockchain. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

Users' funds are locked and at least one user must burn 0.25% of the basket token supply to unlock the basket, though the publisher must be malicious and the timelock gives users a 24-hour warning to withdraw.

What the attacker needed

Publisher is malicious; users hold funds in the basket; 24-hour timelock warning

The fix

The report does not provide a specific fix, but suggests the auction mechanism is shaky and should account for changes in token values over time.

How it was found

  1. The publisher proposes a new index with a 1-day timelock, setting minIbRatio to the maximum value.
  2. After the timelock, the publisher calls publishNewIndex, starting an auction that cannot succeed.
  3. Users cannot enter or exit the basket while the auction is ongoing.
  4. A user must create a bond and wait a day, then call Auction.bondBurn to reset the auction and allow withdrawals, burning 0.25% of the basket token supply.

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.

A basket is like a shared fund. The publisher can start an auction to change what's in the fund, and during the auction users can't take their money out. The publisher can set a rule that makes every auction bid fail, so the auction never ends. The only way for users to get their money back is to burn some of their own fund tokens, which costs them money.

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.

More by TomFrenchBlockchain

View all

28 more disclosed reports, best first.

More from Kuiper contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.