Broken streaks still pass jackpot eligibility in spin contract
The Spin contract checks jackpot eligibility using the stored streak count instead of the freshly computed current streak, so a user whose streak has lapsed can still claim the jackpot. An attacker could therefore obtain jackpot rewards without meeting the consecutive-spin requirement.
Originally disclosed on Immunefi
- Disclosed after under an hour
52449 sc high broken streaks still pass jackpot eligibility in spin contract
Submitted on Aug 10th 2025 at 19:25:14 UTC by @farman1094 for Attackathon | Plume Network
- Report ID: #52449
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/spin/Spin.sol
- Impacts:
- Contract fails to deliver promised returns, but doesn't lose value
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief/Intro
The Spin contract contains a broken logic flaw in its jackpot eligibility check: it verifies a user's "streak count" using outdated data instead of the actual current streak. As a result, users who have broken their streak (i.e., missed spins for one or more days) may still be able to claim the jackpot reward, violating the intended requirement that only users with an active, consecutive streak are eligible.
Vulnerability Details
In the Spin contract's handleRandomness function, the eligibility to claim a jackpot is checked using the user's stored streak count (userDataStorage.streakCount) before it is updated:
else if (userDataStorage.streakCount < (currentWeek + 2)) {
// Not enough streak count to claim Jackpot
...
}
However, the actual current streak has already been calculated based on the user's last spin timestamp and the present day, using the _computeStreak function, but not used.
uint256 currentSpinStreak = _computeStreak(user, block.timestamp, true);
If a user has not spun for several days, their streak should be considered broken and reset to one. But the check above compares the old, stored value, which may still be high if the user previously had a long streak. This allows users with expired streaks to pass the jackpot eligibility check, even though their streak is not consecutive.
{% hint style="warning" %} Impact: This vulnerability allows users to claim jackpot rewards without meeting the intended requirements. The integrity of the reward system is compromised, potentially leading to significant financial loss as rewards are claimed by users who shouldn't be eligible. {% endhint %}
Solution
We can use the current computed streak for the comparison:
uint256 currentSpinStreak = _computeStreak(user, block.timestamp, true);
If we do not want to consider this current spin to add in streak we can subtract one and use that for comparison.
{% hint style="info" %}
Use the computed currentSpinStreak (optionally adjusted by -1 if the current spin should not be counted) instead of the stored userDataStorage.streakCount when checking jackpot eligibility.
{% endhint %}
Proof of Concept
{% stepper %} {% step %}
Build a streak
User builds up a streak count higher than the required threshold (e.g., 10). {% endstep %}
{% step %}
Stop spinning
User stops spinning for several days (streak should reset). {% endstep %}
{% step %}
Old state remains
The old streak value remains in storage not updated yet. {% endstep %}
{% step %}
Re-spin and compute current streak
When spinning again and hitting a jackpot, the contract computes the streak which should be 0 or 1 now.
// _computeStreak
uint256 lastSpinTs = userData[user].lastSpinTimestamp;
if (lastSpinTs == 0) {
return 0 + streakAdjustment;
}
uint256 lastDaySpun = lastSpinTs / SECONDS_PER_DAY;
uint256 today = nowTs / SECONDS_PER_DAY;
if (today == lastDaySpun) {
return userData[user].streakCount;
} // same day
if (today == lastDaySpun + 1) {
return userData[user].streakCount + streakAdjustment;
} // streak not broken yet
return 0 + streakAdjustment; // broken streak
{% endstep %}
{% step %}
Incorrect eligibility check
But in the comparison of streak for jackpot checks it checks with old state instead of the updated one, which could allow the user to claim the jackpot despite an expired streak:
// handleRandomness
} else if (userDataStorage.streakCount < (currentWeek + 2)) {
// Not enough streak count to claim Jackpot
}
{% endstep %} {% endstepper %}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The jackpot eligibility check compares the stored streak count rather than the value returned by _computeStreak, which already accounts for missed days.
Impact
Users could claim jackpot rewards without meeting the consecutive-streak requirement, compromising the reward system and potentially causing financial loss.
What the attacker needed
A user account with a prior streak; ability to spin and hit a jackpot
The fix
The check should use the computed current streak (optionally minus one if the current spin should not count) instead of the stored streak count.
How it was found
- Build a streak count above the required threshold.
- Stop spinning for several days so the streak should reset.
- The old streak value remains in storage, not yet updated.
- Spin again and hit a jackpot; the contract computes a current streak of 0 or 1.
- The eligibility check still uses the old stored streak, allowing the claim.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract is a program on a blockchain that holds and moves funds. This one rewards users who spin every day in a row, but when deciding who wins the jackpot it looks at an old saved number rather than the real current streak, so someone who skipped days can still win.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.