TokenLaunchHook contract contains a critical race condition vulnerability in its liquidity initialization logic. When _afterInitialize() fails to set initialLiquidity (due to hook misconfiguration or pool manager edge cases), the contract falls back to reading current pool liquidity during the first swap. This allows attackers to sandwich the pool initialization with massive liquidity injections, artificially inflating the recorded initialLiquidity value. Consequently, per-swap limits (calculated as a percentage of initialLiquidity) become orders of magnitude higher than intended, completely neutralizing the hook's anti-bot protections during token launches.Likelihood: HIGH
The fallback triggers automatically whenever initialLiquidity remains unset after pool initialization—a realistic scenario when:
Hook is attached after pool initialization (common deployment mistake)
_afterInitialize() hook callback fails silently due to gas limits or pool manager edge cases
Multiple hooks compete for initialization callbacks causing race conditions
Sandwich attacks on pool initialization are trivial to execute with existing MEV bots (Flashbots, EigenPhi) that monitor mempool for PoolManager.initialize() calls
Impact: CRITICAL
Swap limits become 100–1000× higher than intended (e.g., 5% of $20M instead of 5% of $200k), enabling attackers to:
Drain liquidity pools within seconds of launch
Front-run legitimate buyers with massive orders
Manipulate token price before retail participants can enter
Complete failure of the hook's primary security purpose—protection against bot activity during token launches—while giving operators false confidence that limits are active
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.