The EggVault contract allows arbitrary users to register themselves as depositors of NFTs by calling the public depositEgg(uint256 tokenId, address depositor) function. Since this function does not enforce that the depositor is the actual sender of the NFT, it is vulnerable to spoofing and front-running.
The vault assumes that whoever calls depositEgg() is the legitimate depositor. In practice, anyone can call this function and register any address as the depositor, even after someone else has already transferred the NFT to the vault. This breaks the trust model of deposit and ownership.
Anyone can register themselves as depositor and steal NFTs deposited by others.
Legitimate owners lose the ability to withdraw their assets.
Causes permanent asset loss and trust violations in the vault contract.
Manual review
Foundry test suite
Custom exploit test using vm.prank() and frontrunning simulation
Remove the depositEgg() function.
Implement the IERC721Receiver interface in the vault.
Register depositor inside onERC721Received using the from parameter.
Then, users can deposit their NFTs securely via the EggHuntGame Function depositEggToVault:
Front-running depositEgg allows deposit ownership hijacking.
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.