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 `withdraw()` function is intended as an owner-only post-hunt recovery function, but the implementation does not actually enforce any ownership check before transferring the full remaining balance to owner. The function only requires that `claimsCount >= MAX_TREASURES` and that the contract balance is nonzero, after which it sends all ETH to the stored owner address regardless of who called the function. Therefore, the access control on the function itself is incomplete because any external account can trigger the withdrawal path once the hunt is considered over.
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.