The EggVault contract contains a critical vulnerability allowing attackers to steal deposited NFTs through transaction front-running. Malicious actors can intercept and manipulate deposit registrations to claim ownership of transferred NFTs before legitimate users complete the deposit process.
Affected Code:
Technical Analysis:
Decoupled Transfer/Registration:
NFT transfer and deposit registration are separate actions
Creates vulnerable time window between transfer and registration
Arbitrary Depositor Assignment:
Any address can call depositEgg with arbitrary depositor parameter
No validation linking depositor to NFT transfer origin
Attack Flow:
Monitor mempool for NFT transfers to vault
Front-run deposit transaction with malicious registration
Legitimate user's deposit transaction subsequently fails
Severity: Critical
Direct Asset Loss: Permanent NFT theft from legitimate users
High Likelihood: Easily exploitable with basic blockchain tools
Systemic Risk: Undermines entire vault functionality
Foundry Test Script:
Key Test Results:
Bob successfully claims ownership of Alice's NFT
Alice's subsequent deposit attempts fail with "Egg already deposited"
Bob withdraws NFT to their own address
Foundry: For vulnerability reproduction and testing
Manual Code Review: Identified decoupled transfer/deposit flow
Deepseek: Exploring issue with Deepseek
Immediate Fix:
Additional Measures:
Input Validation:
Reentrancy Protection:
Or use OpenZeppelin's ReentrancyGuard contract.
Post-Fix Verification:
All deposits must occur through safeTransferFrom
Depositor address automatically set to transfer initiator
Eliminates arbitrary depositor assignment
Atomic transfer+registration prevents front-running
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.