As the doc note the withdraw()function should be called by owner.
Due to the bug, any user can call the withdraw()function.
Likelihood:
Reason 1: Due to lack of access control, any user can call withdraw()function.
Impact:
Impact 1: The withdraw() function lacks any access control modifier or msg.sender check, allowing any external address to trigger the withdrawal of all contract funds to the owner. While funds are sent to the correct owner address, the timing and initiation should be under owner control.
Any user can successfully call the withdraw()function when other requirements are met.
Add access control, a predefined modifier onlyowner, 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.