NFT Hub implementation deviates from ERC721 for transfer functions
The NFT Hub contract overrides transfer functions but ignores approved addresses, so transfers initiated by approved addresses fail. This breaks compatibility with ERC721 and may cause issues with NFT platforms.
Submitted by 0xRajeev
ERC721 standard and implementation allows the use of approved addresses to affect transfers besides the token owners. However, the L2 NFT Hub implementation deviates from ERC721 by ignoring the presence of any approvers in the overriding function implementations of transferFrom() and safeTransferFrom().
The impact is that the system interactions with NFT platforms may not work if they expect ERC721 adherence. Users who interact via approved addresses will see their transfers failing for their approved addresses.
Given that the key value proposition of this project is the use of NFTs, the expectation will be that it is fully compatible with ERC721.
Recommend adding support for approval in NFT transfers.
mcplums (Reality Cards) commented:
This is a nice one, I see no reason why we can’t implement this
Splidge (Reality Cards) confirmed:
Yes, we will need to add this, although we will need to override the approvals until the market has locked and the cards true owner is discovered.
Splidge (Reality Cards) resolved:
I’ve changed from overriding specific functions which could be dangerous if we were to upgrade to an OpenZeppelin implementation that had alternative transfer functions. Now we use the
_beforeTokenTransferhook and check that only the factory or the market can do a transfer before the market has entered the withdraw state. Implemented here
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 contract overrides transferFrom and safeTransferFrom without checking for approved addresses, deviating from the ERC721 standard.
Impact
Transfers via approved addresses fail, and interactions with NFT platforms expecting ERC721 may not work.
What the attacker needed
Approved address set; ERC721-compatible platform interaction
The fix
The team added approval support by using the _beforeTokenTransfer hook to restrict transfers to the factory or market until the withdraw state.
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.
ERC721 is a standard for NFTs that lets owners approve other addresses to transfer their tokens. This project's transfer functions ignore those approvals, so approved addresses cannot move tokens. That means the NFT does not behave like a standard NFT, which can confuse other platforms.
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.