Tokens can get stuck in NFTXMintRequestEligibility
The NFTX mint request contract ignores the amounts array for ERC721 tokens, allowing a user to request a mint with an amount of zero. The ERC721 transfer still occurs, but the token becomes stuck because the reclaim function requires a positive amount.
NFTX contest
Originally disclosed on Code4rena
When dealing with ERC721 (instead of 1155) the amounts array is ignored, which leads to an issue.
User can call NFTXMintRequestEligibility.requestMint for an ERC721 with amounts[i] = 0. The ERC721.transferFrom is still executed but user cannot reclaimRequestedMint later and the NFT is stuck as it checks (amounts[i] > 0).
Tokens can get stuck. Also, subscribers to Request event could be tricked by specifying amounts[i] > 1 in the ERC721 case, as only one token was transferred, but the amount multiple quantities get logged.
Recommend that requestMint: Check amounts[i] == 1 in ERC721 case, amounts[i] > 0 in 1155 case.
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
Likely the contract fails to validate that the amount is exactly one for ERC721 transfers, and the reclaim function only allows amounts greater than zero, creating a mismatch.
Impact
Tokens can get stuck, and event subscribers could be misled by incorrect amount logs.
What the attacker needed
Access to requestMint function; ERC721 token
The fix
The `requestMint` function should check that `amounts[i] == 1` for ERC721 and `amounts[i] > 0` for ERC1155.
How it was found
- Call `NFTXMintRequestEligibility.requestMint` for an ERC721 with `amounts[i] = 0`.
- The ERC721 transfer is executed, moving the token to the contract.
- Attempt to call `reclaimRequestedMint` later, which fails because it checks `amounts[i] > 0`.
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.
This is a smart contract bug where a function that handles NFT minting does not properly check the quantity you specify for ERC721 tokens. If you say you want zero tokens, it still moves your NFT into the contract, but later you cannot get it back because the contract only allows reclaiming if the amount was greater than zero. So your NFT gets stuck.
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.