The primary vulnerability stems from a critical logic error in the claim() function of TreasureHunt.sol. The double-spend prevention check incorrectly references an uninitialized immutable variable _treasureHash (set to 0), instead of the function parameter treasureHash. This allows attackers to repeatedly claim the same treasure hash without restriction.
Likelihood: High
Exploitation requires no specialized tools. An attacker simply replays a single valid proof and hash. Since the contract fails to mark the specific hash as "used" effectively, the same transaction can be sent repeatedly until the contract is empty.
Impact: High
Total Loss of Funds: An attacker can drain the entire 100 ETH reward pool using a single discovery.
This PoC demonstrates the Double-Spend exploit where a single proof drains the contract due to the faulty _treasureHash check.
Draining the Contract (Double-Spend):
The fix requires a two-step approach to restore both security and functionality.
Solidity Fix: Change the check in claim() to reference the function parameter treasureHash instead of the uninitialized _treasureHash.
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.