51041 sc high streak count misuse in jackpot eligibility allows theft of user funds
Description
Brief/Intro
Vulnerability Details
uint256 currentSpinStreak = _computeStreak(user, block.timestamp, true);
// …
if (keccak256(bytes(rewardCategory)) == keccak256("Jackpot")) {
uint256 currentWeek = getCurrentWeek();
// I believe the contract uses old streakCount, not currentSpinStreak:
if (userDataStorage.streakCount < (currentWeek + 2)) {
userDataStorage.nothingCounts += 1;
rewardCategory = "Nothing";
rewardAmount = 0;
emit NotEnoughStreak("Not enough streak count to claim Jackpot");
} else {
userDataStorage.jackpotWins++;
lastJackpotClaimWeek = currentWeek;
}
}
// …
// only _after_ the check do we write:
userDataStorage.streakCount = currentSpinStreak;Impact Details
References
Proof of Concept
Recommendation
Previous49738 sc insight active users in prize pool loose invested raffle tickets when raffle removeprize is called Next52944 sc high the requestcommisionclaim function can only claim commission on tokens that are currently reward tokens
Was this helpful?