The withdraw() function is intended to allow the owner to reclaim contract funds after all treasures have been claimed. However, the function has no access control — any address can call it once claimsCount >= MAX_TREASURES. Funds always transfer to the hardcoded owner address so direct theft is impossible, but any caller can force the withdrawal at an arbitrary time, removing the owner's ability to control timing.
Likelihood:
Condition claimsCount >= MAX_TREASURES is publicly readable — anyone can monitor it
No capital or special access required — a single transaction from any address
Impact:
Owner loses control over withdrawal timing — e.g. forced out during high gas periods
Combined with the replay attack, an attacker can max out claimsCount and immediately trigger withdraw(), closing the hunt programmatically
Contradicts explicit design intent — NatSpec and the github repo says "Allow the owner to withdraw" and the contract defines an OnlyOwnerCanFund error, yet the symmetric withdrawal has no guard
Just add the onlyOwner modifier to the function.
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.