Faulty event emisssion in claim function causing wrong information being logged
The 'claim' function is used by the recipient to claim their reward using the zk proof and the treasure hash
At the end of the function however the event is emitted with wrong information.
Likelihood:
The payment goes out to the 'recipient' but it will be shown as going to msg.sender by off-chain indexers and explorers.
Impact:
The wrong address will be displayed as the beneficiary when the event logs out
Anyone can submit valid ZK proofs on behalf of different callers and misdirect who "appeared" to have found the treasure in the event logs.
Misleading leaderboards or statistics
This PoC test shows a test that shows how one participant calling the 'claim' function can lead to misleading data being logged due to the bug in the event emission code.
The mitigation is not complicated just correct the address logged off in the event to the correct one that is the 'recipient' not 'msg.sender'
The event is declared as event `Claimed(bytes32 indexed treasureHash, address indexed recipient);`, which clearly indicates that the second indexed field is meant to represent the reward recipient, but `claim()` emits `Claimed(treasureHash, msg.sender)` instead of `Claimed(treasureHash, recipient)`, even though the ETH transfer is sent to recipient and the proof itself is constructed around the public inputs (treasureHash, recipient). As a standalone finding, this is appropriately low severity because it is fundamentally an event/accounting inconsistency rather than a direct loss-of-funds issue: the core state transition and payout still follow the intended recipient, but off-chain consumers reading the event log will observe incorrect metadata about who was associated with the claim.
The event is declared as event `Claimed(bytes32 indexed treasureHash, address indexed recipient);`, which clearly indicates that the second indexed field is meant to represent the reward recipient, but `claim()` emits `Claimed(treasureHash, msg.sender)` instead of `Claimed(treasureHash, recipient)`, even though the ETH transfer is sent to recipient and the proof itself is constructed around the public inputs (treasureHash, recipient). As a standalone finding, this is appropriately low severity because it is fundamentally an event/accounting inconsistency rather than a direct loss-of-funds issue: the core state transition and payout still follow the intended recipient, but off-chain consumers reading the event log will observe incorrect metadata about who was associated with the claim.
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.