Scope: contracts/src/TreasureHunt.sol
The post-hunt payout function is declared without any access control:
The funds still flow to owner, so this is not a direct theft. But
the documented flow in the README/comments describes a
"owner withdraws after the hunt is over" step — which implies the
owner should be able to time/sequence the withdrawal. Without
onlyOwner, any third party can force-trigger the transfer the moment
claimsCount >= MAX_TREASURES becomes true, interleaving with other
post-hunt operations the owner may have planned (fresh funding,
pausing, deploying another hunt, etc.).
Likelihood: HIGH — trivially callable by anyone after the hunt
ends.
Impact: LOW — no ETH theft is possible (recipient is hard-coded
to owner), but the flow is not what the README describes.
Either add the onlyOwner modifier, or document explicitly that
post-hunt withdrawal is intended to be callable by anyone:
(The onlyOwner modifier is already defined on line 53.)
This finding was identified and written up with the assistance of an
autonomous AI auditor (Anthropic Claude).
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.