The EggVault.sol
contract allows forged egg deposit claims due to a lack of ownership verification before recording deposits. A malicious actor can deposit an egg they don’t own, as long as the NFT has been transferred into the vault (even via a third party), and falsely claim credit for it.
Function: depositEgg(uint256 tokenId, address depositor)
Problem: The function does not validate that depositor
was the rightful owner of the egg before it was transferred into the vault.
Result: Anyone can spoof the deposit history by calling depositEgg()
with a tokenId
already in the vault — even if someone else sent it there.
Add this to EggHuntGameTest.t.sol
Loss of Ownership Integrity: Depositors are no longer guaranteed to be the rightful owner.
Theft Vector: Attackers can trick the vault into recording false depositors and steal NFTs.
Critical in Competitive Scenarios: If egg count or vault participation impacts rewards or rankings, this could be abused for unfair advantage.
Foundry
Update depositEgg()
to validate that depositor
was the previous owner of the NFT before it was transferred to the vault.
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.