Expected behavior: Demand size (number of items requested) must not be manipulable by customers, miners, or contract owners in a way that gives financial advantage.
Actual behavior: Demand size is derived from keccak256(block.timestamp, msg.sender) which is predictable and partially controllable by the caller and by miners.
Explanation:
Because block.timestamp is set by miners and msg.sender is controlled by the caller, an attacker can repeatedly call (or craft a contract) and attempt to influence seed to maximize requested. Miners can also reorder or timestamp blocks to favor larger demands.
Likelihood:
High : miners and callers can influence timestamp and msg.sender. On testnets or colluding miners, manipulation is trivial.
Impact:
Over-requesting items repeatedly (higher revenue to company) or draining limited inventory in CompanyGame.
Economic manipulation: attacker increases chance of larger orders, potentially gaining advantage (arbitrage, reputation manipulation).
blast(n) deploys n helpers; each helper forwards its ETH to trigger_demand() and then self-destructs, returning leftover to the original EOA (via tx.origin).
Keep n small on real networks to avoid gas limits. Use on local/testnet only.
If you want, I can make it even shorter (e.g., single helper deploy function) or add a small withdraw in Attacker.
Replace on-chain pseudo-randomness with safer approaches or remove randomness:
Option A — Use an oracle (Chainlink VRF) for randomness (recommended for production):
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.