_unstake does not validate users remaing stake
The unstake function does not check that a user's remaining stake stays at or above the minimum stake amount. A user can partially unstake and be left with a tiny balance, which can cause reward calculations to truncate to zero and leave the user in validator staker lists.
Originally disclosed on Immunefi
- Disclosed after under an hour
51519 sc low unstake does not validate users remaing stake
Submitted on Aug 3rd 2025 at 16:53:12 UTC by @funkornaut for Attackathon | Plume Network
- Report ID: #51519
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol
Description
Brief / Intro
Stakers can end up with a staked balance that is less than minStakeAmount after calling unstake.
Vulnerability Details
Staking requires users to stake at least a minStakeAmount. Users can unstake a specific amount via:
function unstake(uint16 validatorId, uint256 amount)
Within the internal _unstake(uint16 validatorId, uint256 amount) implementation there is no validation ensuring the staker's remaining stake is at least minStakeAmount. As a result, a user who originally met the minimum can partially unstake and remain with a balance below the minimum.
Impact Details
-
Possible reward calculation truncation: The reward computation multiplies the (now tiny) user stake with a per-token reward delta and divides by a precision constant:
uint256 grossRewardForSegment = (userStakedAmount * rewardPerTokenDeltaForUserInSegment) / PlumeStakingStorage.REWARD_PRECISION;For extremely small userStakedAmount values, the multiplication may be smaller than REWARD_PRECISION, causing truncation to 0 and permanent loss of accumulated rewards.
-
State inconsistency and future protocol risks:
- Validator relationship tracking: Users with tiny stakes remain in validator staker lists indefinitely.
- Economic model violation:
minStakeAmountexists to ensure meaningful participation; leaving sub-minimum stakes undermines intended reward behavior. - Potential DoS vector: Attackers could create many tiny stakes across validators. While current code may not iterate these arrays in harmful ways, future changes that iterate them could be vulnerable to gas-limit attacks.
References
- https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol?utm\\_source=immunefi#L366-L390
- https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/lib/PlumeRewardLogic.sol#L339-#L341
Proof of Concept
{% stepper %} {% step %}
Step
User stakes 1 ETH (meets minStakeAmount). {% endstep %}
{% step %}
Step
User unstakes 0.999999... ETH, leaving 1 wei staked:
unstake(validatorId, 999999999999999999) // 0.999999... ETH
{% endstep %}
{% step %}
Step
Result:
- User now has 1 wei staked (below minStakeAmount).
- Reward calculations can truncate to 0.
- User remains in the validator's staker list indefinitely. {% 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
Likely the internal unstake routine lacks a check that the remaining stake is at least minStakeAmount after a partial withdrawal.
Impact
A user could keep a sub-minimum stake, which may cause accumulated rewards to truncate to zero and leaves the user in validator staker lists; the report also notes a possible future denial-of-service risk if those lists are iterated.
What the attacker needed
A staked balance at or above the minimum; ability to call unstake
How it was found
- User stakes an amount that meets the minimum stake amount.
- User calls unstake with an amount that leaves a tiny remainder, such as one wei.
- The user is left with a stake below the minimum, reward calculations can truncate to zero, and the user stays in the validator staker list.
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 staking contract lets people lock tokens and earn rewards, and it requires a minimum amount to take part. This report says the withdrawal function does not check that what is left after a partial withdrawal still meets that minimum. So someone can withdraw almost everything and keep a tiny balance, which can make their reward maths round down to nothing.
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.