Bypass of minimum stake enforcement via partial unstake
The staking contract checks the minimum stake amount only when tokens are staked, not when they are partially withdrawn. A user can stake exactly the minimum and then unstake part of it, leaving an active stake below the required minimum.
- Disclosed after under an hour
50914 sc low bypass of minimum stake enforcement via partial unstake
Submitted on Jul 29th 2025 at 17:00:55 UTC by @light279 for Attackathon | Plume Network
- Report ID: #50914
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol
- Impacts:
- Unbounded gas consumption
- Smart contract unable to operate due to lack of token funds
Description
Brief/Intro
The Plume staking contract enforces a minimum stake amount $.minStakeAmount during the staking process to ensure that users contribute a meaningful amount of tokens. However, the same constraint is not enforced during partial unstakes. As a result, users can bypass the minimum stake requirement and remain staked with less than the required minimum.
Vulnerability Details
The StakingFacet::stake function correctly enforces a check ensuring that the amount being staked is not less than $.minStakeAmount:
function _validateStakeAmount(uint256 amount) internal view {
PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
if (amount == 0) {
revert InvalidAmount(0);
}
@> if (amount < $.minStakeAmount) {
revert StakeAmountTooSmall(amount, $.minStakeAmount);
}
}
{% stepper %} {% step %}
How the bypass works
- Stake exactly the minimum amount (passes validation).
- Call
StakingFacet::unstake(uint16 validatorId, uint256 amount)with a partial unstake less than the staked amount. - The remaining stake falls below the minimum threshold because the unstake flow does not re-validate the user's remaining stake against
$.minStakeAmount. {% endstep %} {% endstepper %}
There is no constraint such as:
if (newStakeAmount != 0 && newStakeAmount < $.minStakeAmount) {
revert RemainingStakeBelowMinimum();
}
Thus, users can keep an active stake that is less than what the protocol originally intended to allow.
Impact Details
This bug undermines the protocol's invariant that users should always have at least the minimum stake amount. Possible consequences include:
- Inconsistent enforcement of staking rules across staking vs unstaking flows.
- Degraded validator staking metrics, since total staked values and user counts may reflect sub-minimum stake participants.
References
Proof of Concept
{% stepper %} {% step %}
- Assume $.minStakeAmount = 1 ether.
- Alice calls
stake(validatorId)with exactly 1 ether. This passes validation. - Alice calls
unstake(validatorId, 0.1 ether). - Now, Alice has 0.9 ether staked (below the minStakeAmount).
- Alice remains in the system with an invalid partial stake that could:
- Still earn rewards,
- Be counted in validator's staker list,
- Trigger edge cases elsewhere in the protocol. {% 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 partial unstake path never re-checks the remaining stake against the minimum stake amount, unlike the stake path.
Impact
The protocol's rule that every staker holds at least the minimum is broken, which could let sub-minimum stakes still earn rewards and skew validator staking metrics; the report does not show a direct loss of funds.
What the attacker needed
A staked position at the minimum amount
The fix
The unstake flow should reject a partial unstake that would leave a non-zero remaining stake below the minimum stake amount.
How it was found
- Stake exactly the minimum amount, which passes validation.
- Call the unstake function with an amount smaller than the full stake.
- The remaining stake is now below the minimum and stays active.
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 sets a smallest allowed amount so each staker counts for something. The contract checks that amount when someone stakes, but not when they take part of it back, so a person can end up staked with less than the smallest allowed amount.
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.