The trigger_demand() function in CustomerEngine.vy derives a pseudo-random seed from block.timestamp and msg.sender:
This is insecure because both inputs are predictable and partially controllable:
block.timestamp can be nudged by miners/validators within protocol allowances.
msg.sender is attacker-controlled; an attacker can try many EOAs or contract addresses to bias the outcome.
Because this seed directly influences economic behaviour (requested items and extra-item chance), attackers can bias demand to inflate profit/reputation or otherwise distort simulation results.
Likelihood:
High — the random seed can be manipulated through multiple calls or timestamp control.
Impact:
High — allows attackers to bias item purchase outcomes and distort company performance.
Measure inventory reduction after multiple trigger_demand() calls from different accounts while advancing block time past cooldown. If reductions vary, randomness is manipulable.
Run with:
What this shows?
If unique_deltas contains two or more different values, varying msg.sender and timestamp produced different demand sizes — demonstrating manipulable randomness.
Replace the insecure seed derivation with a secure randomness source. Preferably use Chainlink VRF for economic flows. If VRF is not feasible, a commit–reveal scheme can be used. Avoid using block.timestamp or msg.sender alone. As a temporary mitigation, blockhash(block.number - 1) can reduce timestamp manipulation, but it is not fully secure.
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.
The contest is complete and the rewards are being distributed.