The protocol intends to allow users to claim one "Snow" token per week via the earnSnow() function. This feature is governed by a global one-week cooldown timer, s_earnTimer, which is updated every time earnSnow() is successfully called.
The vulnerability is that the buySnow() function—which is used for purchasing tokens—also resets this same global s_earnTimer. Because any user can call buySnow() at any time, a single purchase will reset the one-week waiting period for all users. This continuous resetting ensures that the time check in earnSnow(), block.timestamp < (s_earnTimer + 1 weeks), will always be true, causing the function to perpetually revert and making it impossible for anyone to ever earn a "Snow" token.
Likelihood: High
This issue is triggered by any successful call to buySnow(). Normal, expected user activity (purchasing tokens) is sufficient to indefinitely break the earnSnow() function for the entire protocol.
Impact: High
Permanent Denial of Service on a Core Feature: The earnSnow() function is rendered completely and permanently unusable. A key advertised feature of the protocol is non-functional.
Broken Economic Incentive: The ability to earn a free token is a significant incentive for user participation and retention. The failure of this feature undermines the protocol's value proposition, breaks user trust, and may be considered a failure to deliver on the protocol's promise.
The following test demonstrates the DoS scenario. ashley successfully earns a token, starting the one-week cooldown. Just before the week is over, another user, jerry, buys a token. This resets the timer. When ashley tries to claim her token after the original week has passed, the transaction reverts because the timer was reset by jerry's purchase.
The state variables for different protocol features should be kept separate to prevent unintended interactions. The buySnow() function should not modify the timer that exclusively governs the earnSnow() mechanic.
Remove the line that resets s_earnTimer from the buySnow() function.
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.