SNARKeling Treasure Hunt

First Flight #59
Beginner FriendlyGameFiFoundry
100 EXP
Submission Details
Impact: low
Likelihood: low

Wrong value emitted `Claimed` event

Author Revealed upon completion

Root + Impact

Description

The claim function emits

event Claimed(bytes32 indexed treasureHash, address indexed recipient);

The recipient address is supposed to be emitted yet it emits the msg sender who is not allowed to be the recipient:

emit Claimed(treasureHash, msg.sender);

Risk

Likelihood: high

  • It will be emitted during every call to claim

Impact:

  • Offchain observers will be reading the wrong value thinking it's the recipient

Proof of Concept

Nil

Recommended Mitigation

- emit Claimed(treasureHash, msg.sender);
+ emit Claimed(treasureHash, recipient);

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!