Snow::earnSnow can be front-run, allowing attackers to steal rewards from legitimate users.The Snow::earnSnow function is a public function with no access control that allows anyone to call it once 1 week has passed since the last snow minting. This creates a front-running vulnerability where malicious actors can monitor the mempool and front-run legitimate users' transactions to claim the reward for themselves.
Likelihood:
The function mints 1 snow token to msg.sender without verifying that the caller is entitled to the reward. Any user can call this function and claim the reward once the 1-week timer expires.
Impact:
Attackers can front-run legitimate users who attempt to call earnSnow() and steal the 1 snow token reward
MEV bots can monitor the mempool for earnSnow transactions and submit higher gas price transactions to claim rewards first
Legitimate users lose their earned rewards, leading to unfair token distribution
This creates a gas war scenario where only those willing to pay the highest gas fees can claim rewards
The intended reward mechanism is completely broken as rewards go to front-runners rather than protocol participants
There are several approaches to fix this issue:
Implement a whitelist or access control: Only allow specific addresses (e.g., protocol participants, stakers) to call earnSnow().
Distribute rewards proportionally: Instead of a first-come-first-served mechanism, distribute rewards to eligible users proportionally based on their snow holdings or participation.
Use a commit-reveal scheme: Require users to commit to claiming rewards in advance, preventing front-running.
Track eligible claimers: Maintain a list of addresses eligible to claim rewards based on their participation, and only allow those addresses to claim.
Example fix using access control:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.