Skip to content
Business logic Audit finding Intermediate

Pool Manager can frontrun fees to 100% and use it to steal the value from users

The pool manager can change the entry fee to 100% just before a user deposits, causing the user to lose their entire deposit as fees. The manager can then use the collected fees to withdraw the pool's NFTs.

pedroais Follow

Originally disclosed on Code4rena

Submitted by pedroais

Pool Manager can front-run entry fee to 100% and users could lose all their deposits.

Proof of Concept

Considering: The pool manager is the creator of the pool. Anyone can create a pool. Manager is not a trusted actor.

Anyone can create a pool and get people to join. If there is a big deposit admin could front-run the transaction and set the fee to max which is uint(1 ether) = 10**18 (100% as this is a per token fee).

Function that set fees : https://github.com/code-423n4/2021-12-nftx/blob/194073f750b7e2c9a886ece34b6382b4f1355f36/nftx-protocol-v2/contracts/solidity/NFTXVaultUpgradeable.sol#L119 Max fees are 1 ether : https://github.com/code-423n4/2021-12-nftx/blob/194073f750b7e2c9a886ece34b6382b4f1355f36/nftx-protocol-v2/contracts/solidity/NFTXVaultFactoryUpgradeable.sol#L122

The manager could benefit from this by having other pool assets deposited in staking so he would receive fees in Vtokens and could use them to withdraw the nfts.

Recommended Mitigation Steps

Add a timelock to change fees. In that way, frontrunning wouldn’t be possible and users would know the fees they are agreeing with.

0xKiwi (NFTX) acknowledged, but disagreed with high severity and commented:

Most users aren’t on vaults that aren’t finalized. We warn users for any vaults that arent finalized and we don’t present them on our website. Acknowledging and disagreeing with severity.

LSDan (judge) decreased severity to medium and commented:

In my view, this is a medium risk. While user funds are at direct risk, the likelihood of this happening or being worth the effort is low. As the sponsor states, it’s very rare for a user to interact with an un-finalized vault. The user would have to be directly linked to the vault and then ignore the giant warning presented front and center in the UI. If that warning were to be removed, however, the risk would increase. This external requirement is the only reason I’m going with medium and not low.


The original report as published on Code4rena, by pedroais. 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

Root cause

The fee can be changed instantly by the pool manager without any delay, allowing them to front-run user deposits.

Impact

Users could lose all their deposits, but the risk is limited because users rarely interact with unfinalised vaults and are warned in the UI.

What the attacker needed

Attacker is the pool manager; victim deposits into an unfinalised vault; victim ignores a warning in the UI

The fix

A timelock should be added to fee changes so that front-running is impossible and users know the fees in advance.

How it was found

  1. The pool manager creates a pool and attracts users to deposit.
  2. A user submits a large deposit transaction.
  3. The manager sees the pending deposit and front-runs it by setting the fee to the maximum (100%).
  4. The user's deposit is taken entirely as fees, which the manager can use to withdraw NFTs from the pool.

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 pool manager controls the fee charged when someone deposits into their pool. Because the manager can change the fee at any moment, they can watch for a large deposit and quickly raise the fee to 100% before it goes through. The depositor then pays their whole deposit as a fee, which the manager can use to take the pool's valuable items.

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 pedroais

View all

6 more disclosed reports, best first.

More from NFTX 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.