Skip to content

Code4rena

NFTX contest

Every publicly disclosed report for NFTX contest and what kind of bugs they were.

disclosed reports
32
most reported class
Business logic
bug classes found
5
first disclosure
2021
Find NFTX contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what NFTX contest chose to make public.

Smart contracts

transfer return value is ignored

The smart contracts use the ERC20 transfer and transferFrom functions without checking their return values. Some tokens return false instead of reverting on failure, so a failed transfer could go unnoticed, potentially leading to loss of funds.

NFTX contest

Medium
DoS

Malicious receiver can make distribute function denial of service

A malicious fee receiver contract can revert when its receiveRewards function is called, causing the distribute function to fail and block fee distribution. This denial of service affects all fee receivers until the malicious receiver is removed.

NFTX contest

Medium
Business logic

Rewards can be stolen

The NFTXInventoryStaking contract distributes rewards in a single lump when the owner calls receiveRewards, so an attacker can front-run that transaction with a deposit and receive a share of the rewards. After a short lock period, the attacker withdraws the deposit and rewards for a profit.

NFTX contest

Medium
Business logic

Return variable can remain unassigned in _sendForReceiver

The _sendForReceiver function only returns a value in its if branch, so when a receiver has isContract set to false the function implicitly returns false. The distribute function then treats this as a failure and sends the remaining token balance to the treasury instead of the receiver.

NFTX contest

Medium
Business logic

buyAndSwap1155WETH() function may cause loss of user assets

The buyAndSwap1155WETH function passes msg.value (which is zero) instead of the user-supplied maxWethIn to the internal _buyVaultToken call, so the swap fails. If a user mistakenly sends both ETH and WETH, the ETH becomes locked in the contract, causing asset loss.

NFTX contest

High
DoS

A vault can be locked from MarketplaceZap and StakingZap

The marketplace and staking zap contracts check that their vToken balance equals the expected amount after minting, but any user can send vTokens directly to these contracts, causing the check to fail. This makes the vault functionality unavailable for all users on the marketplace.

NFTX contest

High
Smart contracts

Bypass zap timelock

The timelock mint function overwrites an existing longer timelock with a shorter one because it always sets the finish time to the current block timestamp plus the new timelock length. An attacker could reduce a seven-day timelock to two milliseconds by calling deposit in NFTXInventoryStaking.

NFTX contest

Medium
Business logic

buyAndSwap1155WETH Does Not Work As Intended

The buyAndSwap1155WETH function incorrectly uses msg.value instead of maxWethIn when calling _buyVaultToken, so it only works if the user sends both WETH and native ETH equal to maxWethIn. This causes the function to fail for normal users who only supply WETH.

NFTX contest

Medium
Smart contracts

Missing non reentrancy modifier

Many public and external functions in the NFTX contracts lack the nonReentrant modifier that other functions use. The author did not find an exploit, but the judge raised severity because reentrancy is a real risk even without a demonstrated attack path.

NFTX contest

Medium
Business logic

xToken Approvals Allow Spenders To Spend More Tokens

The approve function in xToken contracts was not overridden, so allowances were denominated in shares rather than the equivalent rebalanced vault token amount. As rewards accrued, the approved spender could transfer more underlying tokens than the approver intended.

NFTX contest

Medium
Smart contracts

Low-level call return value not checked

The NFTXStakingZap.addLiquidity721ETHTo function makes a low-level call to refund excess ETH but does not check whether the call succeeded. If the refund call fails, the caller loses the refunded amount.

NFTX contest

Medium
Smart contracts

Fee Distribution Re-Entrancy

The `distribute` function in `NFTXFeeDistributor` lacks access control and calls a fallback on fee receivers, allowing a malicious receiver to re-enter and repeatedly claim its allocation, potentially draining the contract's balance and leaving other recipients with zero.

NFTX contest

Medium
Business logic

Randomization of NFTs returned in redeem/swap operations can be brute-forced

The NFT redemption process used on-chain randomness (nonce and blockhash) to select which NFT a user receives, but a user could repeatedly call the redeem function from a contract and revert if the returned NFT was not the desired one, effectively brute-forcing the randomness. This allowed users to obtain specific NFTs rather than a random one, subverting the intended random distribution.

NFTX contest

Medium
Business logic

getRandomTokenIdFromFund yields wrong probabilities for ERC1155

The random token selection function for ERC1155 vaults ignores the quantity of each token deposited, giving each token ID an equal chance instead of weighting by quantity. An attacker could exploit this to preferentially redeem more valuable NFTs.

NFTX contest

High
Business logic

The direct redeem fee can be circumvented

The random NFT selection during redemption occurs in the same transaction, allowing an attacker to revert if they do not receive the desired NFT. By using Flashbots, they can avoid paying fees for reverted transactions, thereby bypassing the direct redeem fee and potentially reducing earnings for other users.

NFTX contest

Medium
Business logic

Manager can grief with fees

The fee setter in the NFTX vault contract allows the manager to set fees arbitrarily high, with no upper limit. A manager can front-run a user's mint and set a huge fee so the user's NFTs are transferred to the vault but no pool share tokens are minted in return.

NFTX contest

Medium
Crypto

Missing overflow check in flashLoan

The flashLoan function in ERC20FlashMintUpgradeable lacks an overflow check when adding the fee to the loan amount, allowing an attacker to burn zero tokens and avoid repayment. This could lead to a huge profit if the fee is non-zero.

NFTX contest

High