The depositEgg function in the EggVault contract allows unauthorized users to claim ownership of NFTs by calling the function with their address as the depositor parameter. This leads to a vulnerability where anyone can become the recorded depositor of an NFT without actually owning it.
The vulnerability arises from the depositEgg function which takes a depositor address as a parameter. The function does not check if the caller is the actual owner who transferred the NFT to the vault. If a user calls these functions in two different transactions, an attacker could front run the second transaction and claim he is the depositor as soon as the NFT is transferred to the vault. This allows any user to call the function with their address as the depositor, thereby recording themselves as the depositor of the NFT.
This vulnerability allows malicious users to claim ownership of NFTs they do not own.
Manual review
Add a check to verify that the caller is the owner or an approved address for the NFT.
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.