The searchForEgg() The function uses a predictable pseudo-random mechanism to determine whether an NFT (egg) is minted to the caller. The randomness is derived using the following on-chain parameters:
Each of these inputs is either publicly observable, user-controlled, or miner-influenced. As a result, any user can precompute the random outcome off-chain and selectively call searchForEgg() only when the outcome will yield a minted egg.
A vulnerability test was created using Foundry to demonstrate the exploitability of the on-chain randomness logic. The attacker repeatedly simulates future block timestamps and precomputes the randomness result off-chain.
This test simulates an attacker manipulating block.timestamp to precompute the outcome.
Eggs were minted only when the predicted outcome was favorable.
This resulted in a 100% manipulation success rate within the set threshold range.
Fairness Violation: Attackers can win every time, undermining gameplay mechanics.
Economic Risk: If eggs have value, this can lead to monetary exploitation.
Loss of Trust: Honest players are disadvantaged and may abandon the protocol.
Foundry
Replace the current method with a secure randomness oracle, like Chainlink VRF. Alternatively, use a commit-reveal scheme to break predictability.
Insecure methods to generate pseudo-random numbers
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.