Description:
Predictable Inputs
block.timestamp: The block timestamp can be influenced to a small degree by miners (within ~15 seconds of variability), allowing them to manipulate the randomness outcome.
msg.sender: The address of the caller is deterministic and fully controlled by the user executing the transaction.
block.prevrandao: Although this is sourced from the randomness beacon introduced in Ethereum's PoS consensus, it may still be insufficiently random when combined with the other weak factors.
Miner Manipulation
Miners have control over both block.timestamp and block.prevrandao to some extent. By strategically adjusting these values, they can bias the randomness to favor a particular outcome.
Impact:
An attacker can manipulate the contract to select a threshold value in their favor based on the cards they hold. By exploiting the predictable random number generation or controllable variables within the contract, the attacker can influence the outcome of the threshold determination process. This allows them to adjust the game logic or decision-making mechanisms in a way that maximizes their chances of winning or minimizes their losses.
Such manipulation undermines the fairness of the game and creates an unfair advantage, potentially enabling consistent exploitation to drain funds, disrupt gameplay, or deceive other participants. It highlights a critical issue in the reliance on weak or manipulable randomness within smart contracts.
Proof of Concept:
Recommended Mitigation:
Use Chainlink VRF:
Integrate Chainlink's Verifiable Random Function (VRF) to generate cryptographically secure random numbers that are unpredictable and tamper-proof.
Avoid On-Chain Only Randomness:
Avoid relying solely on on-chain inputs like block.timestamp and block.prevrandao.
Combine with off-chain randomness for stronger entropy.
Randomness Manipulation: The randomness mechanism relies on block.timestamp, msg.sender, and block.prevrandao, which may be predictable in certain scenarios. Consider using Chainlink VRF or another oracle for more secure randomness.
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.