The EggVault
contract uses transferFrom
instead of safeTransferFrom
when withdrawing NFTs, which allows transfers to contracts that don't implement the onERC721Received
function. This creates a risk of NFTs becoming permanently locked if they're sent to non-compliant contract addresses with no functions to transfer them back out.
mintEgg
uses '_mint' instead of safemint
which is also not looking for the specific hook implementation on the receiver side.
In the withdrawEgg
function of the EggVault
contract, NFTs are transferred using the unsafe transferFrom
method:
When a contract that doesn't implement onERC721Received calls this function, the transfer will succeed because transferFrom doesn't verify the receiver's ability to handle ERC721 tokens. If the receiving contract has no functionality to move the NFT elsewhere, the token becomes permanently locked.
The ERC721 standard recommends using safeTransferFrom when sending tokens to unknown addresses specifically to prevent this scenario.
The impact of this vulnerability is that NFTs could become permanently lost if withdrawn to contracts that:
Don't implement the onERC721Received function, and
Don't have any functionality to transfer NFTs out
This particularly affects:
Smart contract wallets that don't fully implement ERC721 receiver functionality
Protocol contracts that might interact with the vault
Integration with other DeFi or NFT systems
While this doesn't affect transfers to regular externally owned accounts (EOAs), it presents a significant risk for contract interactions, which are increasingly common in the Web3 ecosystem.
Manual code review
Foundry for creating and running proof of concept tests
Replace the transferFrom call with safeTransferFrom in the withdrawEgg function.
Additionally, ensure the EggVault contract implements the ERC721Holder interface to properly handle incoming NFTs
NFTs are transferred to contracts without onERC721Received implementation.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.