Incorrect parameter type in setjackpotprobabilities
The setter function for jackpot probabilities accepts an array of 8-bit unsigned integers, but the storage variable is an array of 256-bit unsigned integers. This type mismatch limits each probability value to a maximum of 255, preventing administrators from setting intended values up to 1,000,000 and causing the daily jackpot system to operate incorrectly or become unusable.
- Disclosed after under an hour
50973 sc insight incorrect parameter type in setjackpotprobabilities
Submitted on Jul 30th 2025 at 07:20:48 UTC by @Paludo0x for Attackathon | Plume Network
- Report ID: #50973
- Report Type: Smart Contract
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/spin/Spin.sol
Summary
The setJackpotProbabilities function accepts a uint8[7] array but assigns it to a uint256[7] storage variable (jackpotProbabilities). This type mismatch restricts each threshold value to a maximum of 255 (uint8), preventing administrators from setting intended values up to 1,000,000 and causing the daily jackpot system to operate incorrectly or become unusable.
Vulnerability details
{% hint style="warning" %} The setter parameter type and the storage type differ:
- Storage:
uint256[7] public jackpotProbabilities; - Setter:
function setJackpotProbabilities(uint8[7] memory _jackpotProbabilities)
Assigning a uint8[7] to uint256[7] truncates/limits inputs to the uint8 range (0–255), preventing larger intended probability values from being set.
{% endhint %}
Impact
Administrators cannot configure the intended daily jackpot probability thresholds (e.g., values up to 1,000,000). This can make the daily jackpot feature operate incorrectly or become unusable.
If the intended probabilities are always ≤ 255, change the storage to uint8[7] public jackpotProbabilities;. Otherwise, change the setter to accept uint256[7] memory _jackpotProbabilities to match storage.
Proof of Concept
<details> <summary>Relevant code snippet from Spin.sol</summary>// Storage slot expects uint256[7]
uint256[7] public jackpotProbabilities;
// Setter uses uint8[7]
function setJackpotProbabilities(uint8[7] memory _jackpotProbabilities)
external
onlyRole(ADMIN_ROLE)
{
jackpotProbabilities = _jackpotProbabilities;
}
Recommended fix
- If values must support ranges > 255: change the function signature to accept
uint256[7] memory _jackpotProbabilities. - If values are intended to be ≤ 255: change storage to
uint8[7] public jackpotProbabilities.
(Do not change any logic beyond aligning types to intended ranges.)
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 setter function parameter type (uint8[7]) does not match the storage variable type (uint256[7]), limiting input values to the uint8 range.
Impact
Administrators cannot configure the intended daily jackpot probability thresholds (e.g., values up to 1,000,000), which can make the daily jackpot feature operate incorrectly or become unusable.
What the attacker needed
Admin role required to call setter
The fix
The function signature should be changed to accept uint256[7] memory to match the storage type, or the storage type should be changed to uint8[7] if values are intended to be ≤ 255.
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.
In Solidity, numbers have fixed sizes. A uint8 can only hold values from 0 to 255, while a uint256 can hold much larger numbers. The function that sets jackpot probabilities uses the small type, so administrators cannot enter values above 255 even though the storage expects larger numbers.
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.