Description:
The EggVault::setEggNFT
function allowing the owner to change the associated NFT contract (EggstravaganzaNFT) at any time. Similarly, EggstravaganzaNFT
exposes setGameContract()
to update the mint-authorized game contract (EggHuntGame).
This introduces a configuration and desynchronization risk:
If the NFT contract is updated incorrectly, previously deposited NFTs may become inaccessible.
If new NFTs are deposited with the new contract and the system reverts to the old one, both groups of NFTs may be locked and unrecoverable.
No events are emitted, and no restrictions exist to prevent misconfiguration.
Impact:
Permanent loss of access to deposited NFTs.
Inability to withdraw assets associated with outdated configuration.
Inconsistent behavior difficult to trace or resolve on-chain.
Requires off-chain intervention, violating trustless system principles.
Proof of Concept:
Result:
##Tools Used
Manual review, Foundry
Recommended Mitigation:
EggVault Contract:
EggsEggstravaganzaNFT Contract:
If the system requires the ability to update logic contracts, use an upgradeable proxy (e.g. UUPS or Transparent Proxy):
Safely update logic while maintaining state.
Avoid manual desynchronization risks.
Centralized and auditable upgrade logic.
Changing the NFT contract address doesn't update the storedEggs and eggDepositors mappings
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.