RCNftHubL2.safeTransferFrom not according to spec
The safeTransferFrom function in RCNftHubL2 does not check whether the recipient contract implements IERC721Receiver, so tokens can be sent to contracts that cannot handle them. This violates the ERC721 specification and could result in tokens being stuck.
Submitted by cmichel, also found by 0xRajeev
The RCNftHubL2.safeTransferFrom function does not correctly implement the ERC721 spec:
When using
safeTransferFrom, the token contract checks to see that the receiver is an IERC721Receiver, which implies that it knows how to handle ERC721 tokens. ERC721
This check is not implemented, it just drops the _data argument.
Contracts that don’t know how to handle ERC721 tokens (are not an IERC721Receiver) can accept them but they should not when using safeTransferFrom according to spec.
Recommend Implementing the IERC721Receiver check in safeTransferFrom.
Splidge (Reality Cards) confirmed and resolved:
This has been fixed while working on issue #118 commit 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
Impact
Contracts that cannot handle ERC721 tokens can receive them via safeTransferFrom, potentially causing the tokens to be stuck.
What the attacker needed
None
The fix
The issue was fixed by implementing the IERC721Receiver check in safeTransferFrom.
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 non-fungible tokens (NFTs). The safeTransferFrom function is supposed to make sure the receiving contract knows how to handle NFTs, otherwise the token could be lost. Here, that safety check is missing, so NFTs can be sent to contracts that cannot deal with them.
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.