The documented design states withdrawal of leftover funds is an owner-controlled admin flow.
withdraw() sends the entire contract balance to owner, which prevents direct theft, but the function lacks the onlyOwner modifier, allowing any external account to invoke it.
Likelihood:
Any on-chain observer can call this function once claimsCount == MAX_TREASURES.
Bots routinely front-run state-change events to trigger permissionless functions.
Impact:
The owner loses control over the timing of their own withdrawal — a third party forces the transfer at any moment after the hunt ends.
Gas refund griefing: a malicious actor can repeatedly front-run the owner's own withdrawal transaction.
Violates the principle of least privilege and the protocol's documented access control model.
After all 10 treasures are claimed:
Attacker calls withdraw() before owner does.
Add the onlyOwner modifier:
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.