The depositEgg() function in EggVault lacks proper access control, allowing anyone to call it with arbitrary depositor addresses.
The function is declared as public and doesn't verify the caller's identity:
A malicious actor could call this function with someone else's address as the depositor parameter, preventing the actual owner from withdrawing their NFT since withdrawEgg() requires the caller to match the recorded depositor.
Code review
Restrict depositEgg() to be called only by the game contract or implement a role-based access control system. Also consider adding a way for the owner to rescue incorrectly deposited NFTs.
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.