UNIX Gaming exploited via weak on-chain randomness; attacker drained ~1.62 ETH from prize pool using predictable RNG to simulate winning outcomes before committing plays.
Security & Exploits ·
UNIX Gaming, a play-to-win protocol on Optimism, suffered a loss of approximately $2.95K when an attacker exploited weak on-chain randomness in its prize-distribution mechanism. The attack drained roughly 1.62 ETH from the protocol's prize pool while the attacker risked only gas costs and minimal stakes.
The vulnerability lay in how UNIX Gaming's award function selected ETH prize winners using predictable on-chain randomness, computing outcomes via keccak256(seed) % 10000 against per-tier probability weights. Since the seed derived from foreseeable block and participant data, an attacker deployed short-lived contracts to simulate draw results before committing plays. The attacker only deposited funds—0.003 ETH per play, swapped into UNIX, and added liquidity—when simulation confirmed a winning outcome, then atomically claimed top-tier prizes (0.275 and 0.055 ETH) across multiple rounds in a single transaction.
The exploit succeeded because the protocol allowed real-time simulation of randomness outcomes before irrevocable play commitment, enabling the attacker to filter for guaranteed winners. It remains unclear whether the protocol has since implemented commit-reveal schemes or alternative entropy sources to prevent similar attacks.