The implementation creates a Denial of Service (DOS) for free token earners by forcing them to wait 1 week after any user buys tokens, effectively blocking the free claim mechanism for all users.
The Snow token contract implements two separate mechanisms for acquiring tokens:
Buying tokens (can be done anytime)
Claiming free tokens (once per week)
However, the implementation creates a DOS vulnerability by using a global s_earnTimer that is updated in the buySnow() function. This means that when any user buys tokens, it blocks all users from claiming (earning) free tokens for 1 week, even if they have never claimed before.
Likelihood:
HIGH - The DOS can be triggered by any user simply buying tokens, and it affects all users.
Impact:
HIGH - The impact is severe because:
Creates a permanent DOS for free token earners
Any user can block all others from claiming free tokens
Malicious users can keep buying tokens to maintain the DOS
The following test demonstrates the vulnerability:
When Victory buys Snow tokens, it sets the global timer,Ashley is blocked from claiming free tokens even though she never claimed before. Ashley must wait for Victory's timer to expire before she can claim. This creates an unfair advantage and a permanent DOS if users keep buying tokens.
Replace the global timer with a per-user timer using a mapping:
This fix ensures
Each user has their own independent timer
Buying tokens doesn't affect free claims
Users can only be blocked by their own previous claims
The free claim mechanism is protected from DOS attacks
When buySnow is successfully called, the global timer is reset. This inadvertently affects the earning of snow as that particular action also depends on the global timer.
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.