52990 sc low uint8 truncation and missing cap on week index can return wrong zero jackpot amounts low contract fails to deliver promised returns
- Submitted on: Aug 14th 2025 at 15:18:09 UTC by @daxun for Attackathon | Plume Network
- Report ID: #52990
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/spin/Spin.sol
Description
Brief / Intro
determineReward() computes:
uint8 weekNumber = uint8(getCurrentWeek());
- Past the designed 12-week campaign,
jackpotPrizes[weekNumber]often defaults to 0 (uninitialized), so winners can receive 0 unexpectedly. - After 256 weeks, casting to
uint8wraps (mod 256) and can index an unintended bucket, again returning wrong prizes (commonly 0).
Vulnerability Details
initialize()only configures indices0..11. No guard exists indetermineReward()to zero out jackpots post-campaign or cap the index.getWeeklyJackpot()caps the display (if (weekNumber > 11) return (weekNumber, 0, 0);), but this guard is not used indetermineReward().
Impact Details
- Immunefi Impact: Low — Contract fails to deliver promised returns, but doesn't lose value
- After week 12 (or any misconfiguration where
campaignStartDateis old), jackpot payouts can become 0. After week 256, indexing is effectively nondeterministic modulo 256.
References
determineReward()(uint8 weekNumber = uint8(getCurrentWeek());)initialize()(only sets 0..11)getWeeklyJackpot()(has a cap that isn’t applied indetermineReward())
determineReward() (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/spin/Spin.sol#L286)
Proof of Concept
Setup: campaign start > 12 weeks ago
- Set
campaignStartDateto be more than 12 weeks in the past.
Force a jackpot and trigger a spin
- Make
jackpotProbabilities[dayOfWeek]high (or otherwise force a jackpot) and trigger a spin.
observe jackpot index and payout
determineReward()computesweekNumberviauint8(getCurrentWeek()).- Because
weekNumber > 11,jackpotPrizes[weekNumber]is uninitialized (defaults to0). - The user “wins” a 0-amount jackpot.
Long-term wraparound (> 256 weeks)
- If
campaignStartDateis more than 256 weeks ago,uint8(getCurrentWeek())wraps (mod 256) and indexes an unintended bucket (often unset = 0), producing wrong payouts.