Protocol lets validators operate with dust amounts, making attacks risk-free
The partial unstake path in the staking contract never re-checks the minimum stake amount, so a validator can withdraw almost everything and keep operating with a dust balance. A malicious validator could then act against the protocol with almost no funds at risk.
Originally disclosed on Immunefi
- Disclosed after under an hour
50082 sc low protocol lets validators operate with dust amounts making attacks risk free
Submitted on Jul 21st 2025 at 15:10:02 UTC by @holydevoti0n for Attackathon | Plume Network
- Report ID: #50082
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol
- Impacts:
- Permanent freezing of funds
- Protocol insolvency
Description
Brief/Intro
The _unstake function doesn't check if the remaining stake amount is below the minimum stake amount, allowing validators to operate actively while having a dust amount of funds staked (i.e., 1 wei).
Vulnerability Details
The protocol does not enforce the minimum stake amount when a user partially unstakes. It allows stakers/validators to remain with stake amounts below minStakeAmount.
Vulnerable snippet:
https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/StakingFacet.sol#L366-L390
function _unstake(uint16 validatorId, uint256 amount) internal returns (uint256 amountToUnstake) {
PlumeStakingStorage.Layout storage $s = PlumeStakingStorage.layout();
// @audit - Validations does not validate min stake amount
_validateValidatorForUnstaking(validatorId);
if (amount == 0) {
revert InvalidAmount(amount);
}
if ($s.userValidatorStakes[msg.sender][validatorId].staked < amount) {
revert InsufficientFunds($s.userValidatorStakes[msg.sender][validatorId].staked, amount);
}
...
return amount;
}
With the current logic, validators can operate with dust amounts, increasing the likelihood of validators acting maliciously. The invariant that every active validator holds at least the minimum stake amount is broken.
Examples of consequences:
- Two malicious validators could skip voting in the slashing process to avoid each other being slashed.
- Admin deactivates the two validators above; new/existing validators can repeat the same behavior when their stake/funds are dust/below the minimum stake amount.
- Malicious validators acting together can vote to slash legitimate validators, reducing their funds to zero.
Impact
The protocol permits partial unstaking that drops validators below minimum stake requirements, enabling validators to act maliciously with minimal financial risk.
Recommendation
Enforce the minimum stake amount when a user partially unstakes. Suggested patch:
function _unstake(uint16 validatorId, uint256 amount) internal returns (uint256 amountToUnstake) {
PlumeStakingStorage.Layout storage $s = PlumeStakingStorage.layout();
...
+ if ($s.userValidatorStakes[msg.sender][validatorId].staked - amount < $s.minStakeAmount) {
+ revert StakeAmountTooSmall($s.userValidatorStakes[msg.sender][validatorId].staked - amount, $s.minStakeAmount);
+ }
...
}
{% hint style="info" %}
Add a custom error (e.g., StakeAmountTooSmall) if not already present, and ensure the check is consistent with any edge-cases (e.g., full unstake vs partial unstake).
{% endhint %}
Proof of Concept
Add the PoC below into PlumeStakingDiamond.t.sol:
function testStakerCanLeaveValidatorWithDustAmountStaked() public {
uint256 amount = 1e18;
vm.startPrank(user1);
StakingFacet(address(diamondProxy)).stake{value: amount}(
DEFAULT_VALIDATOR_ID
);
assertEq(StakingFacet(address(diamondProxy)).amountStaked(), amount);
// Unstake
StakingFacet(address(diamondProxy)).unstake(DEFAULT_VALIDATOR_ID, 0.9e18);
assertEq(StakingFacet(address(diamondProxy)).amountCooling(), 0.9e18);
assertEq(StakingFacet(address(diamondProxy)).amountStaked(), 0.1e18);
// print total staked for this validator
(,uint256 validatorTotalStaked,) = ValidatorFacet(address(diamondProxy)).getValidatorInfo(DEFAULT_VALIDATOR_ID);
console2.log("minStakeAmount: %e", ManagementFacet(address(diamondProxy)).getMinStakeAmount());
console2.log("Validator has a total staked of %e", validatorTotalStaked);
vm.stopPrank();
}
Run:
forge test --mt testStakerCanLeaveValidatorWithDustAmountStaked -vv --via-ir
Output:
[PASS] testStakerCanLeaveValidatorWithDustAmountStaked() (gas: 554340)
Logs:
minStakeAmount: 1e18
Validator has a total staked of 1e17
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 unstake function validates the request but never checks that the remaining stake stays at or above the minimum stake amount.
Impact
Validators could operate with a dust stake, so colluding validators could skip slashing votes or vote to slash honest validators while risking almost nothing; the report also claims this could lead to permanent freezing of funds and protocol insolvency.
What the attacker needed
A validator stake position; ability to call unstake
The fix
The unstake function should reject a partial unstake that would leave the remaining stake below the minimum stake amount, while still allowing a full unstake.
How it was found
- Stake an amount with the staking function for a validator.
- Partially unstake most of the stake, leaving a small remainder.
- Observe that the validator's total stake is now below the minimum stake amount but the validator remains 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.
Validators put money (a stake) into the protocol as a promise of good behaviour; if they misbehave, that money can be taken away. The protocol says each active validator must keep at least a minimum amount staked, but the code only checks this when staking, not when taking money back out. So a validator can withdraw down to almost nothing and still count as active, which means cheating costs them almost 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.