Skip to content
Business logic Audit finding Intermediate

Staking and unstaking immediately an amount little less than the original staked amount leaves dust stake amounts in the system.

The staking contract only checks the minimum stake amount when tokens are staked, not when they are unstaked. An attacker can stake a valid amount and then immediately unstake almost all of it, leaving a tiny dust stake below the minimum that still earns rewards and bloats the staker list.

WinSec Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52891 sc low staking and unstaking immediately an amount little less than the original staked amount leaves dust stake amounts in the system

Submitted on Aug 14th 2025 at 02:21:03 UTC by @WinSec for Attackathon | Plume Network

Description

Brief/Intro

Staking X amount of tokens and then unstaking immediately an amount equal to X - 1 or X - (minAmount - 1) allows anyone to leave a residual stake amount smaller than the minimum stake. This enables bots to spam with dust amounts, increasing the size of the validatorStakers array and complicating accounting. Additionally, the protocol intends that stakes below the minimum amount should not earn rewards, but these dust stakes will continue to earn rewards.

Vulnerability Details

In stake, restake and restakeRewards functions:

Solidity
    function _validateStakeAmount(
        uint256 amount
    ) internal view {
        PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
        if (amount == 0) {
            revert InvalidAmount(0);
        }
        if (amount < $.minStakeAmount) {
            revert StakeAmountTooSmall(amount, $.minStakeAmount);
        }
    }

The above check ensures that the amount being staked is greater than or equal to the minStakeAmount. But this check can be bypassed by staking and then immediately unstaking an amount slightly smaller than the original stake. That leaves a dust amount (less than minStakeAmount) in the system. The unstake function lacks a check to prevent leaving such dust. The unstake function should ensure that if the amount remaining after unstaking would be less than the minimum stake amount, the function unstakes the whole amount instead of leaving dust.

Impact Details

  • Dust amounts remain in the system, complicating accounting.
  • Allows bots to spam with dust stakes, unnecessarily growing validatorStakers.
  • Dust amounts may continue to earn rewards even though they are below the intended minimum stake.

References

https://github.com/plumenetwork/contracts/blob/fe67a98fa4344520c5ff2ac9293f5d9601963983/plume/src/facets/StakingFacet.sol#L105

Proof of Concept

{% stepper %} {% step %}

Step

User stakes X amount in the protocol by calling the stake function. {% endstep %}

{% step %}

Step

User immediately calls unstake. {% endstep %}

{% step %}

Step

User unstakes an amount equal to X - 1. {% endstep %}

{% step %}

Step

This leaves an amount equal to 1 wei (or another small dust amount) in the system. {% endstep %}

{% step %}

Step

The remaining dust amount is less than the min amount required for staking and thus remains as a dust stake while still potentially earning rewards. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by WinSec. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

Impact

Dust stakes below the minimum remain in the system, can still earn rewards, and can be spammed to grow the validatorStakers array and complicate accounting.

What the attacker needed

Ability to stake and unstake tokens

The fix

The unstake function should unstake the whole remaining balance when a partial unstake would leave less than the minimum stake amount.

How it was found

  1. Stake an amount X that meets the minimum.
  2. Immediately call unstake.
  3. Unstake X minus 1 (or X minus the minimum minus 1).
  4. A dust amount of 1 wei or similar remains staked.

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 to earn rewards, and it sets a minimum amount you must stake. This report shows you can get around that minimum by staking enough and then withdrawing all but a tiny amount, so a leftover 'dust' stake stays behind. That dust still earns rewards and can be repeated many times to clutter the system.

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.

More by WinSec

View all

8 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.