Staked dust positions are not properly prevented
The staking contract enforces a minimum stake amount when creating or increasing a position, but a user can bypass this by staking above the minimum and then unstaking almost all of it, leaving a dust position. An attacker could create many such dust positions, increasing gas costs for anyone iterating over the staker list and potentially causing a denial of service if the list grows beyond the block gas limit.
- Disclosed after under an hour
50551 sc low staked dust positions are not properly prevented
Submitted on Jul 25th 2025 at 23:27:47 UTC by @a16 for Attackathon | Plume Network
- Report ID: #50551
- 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
Description
Brief / Intro
While the staking mechanism validates that amounts below minStakeAmount cannot be directly staked, it is still possible to have less than the minimal amount staked by partially unstaking.
Vulnerability Details
When calling stake(), restake() or stakeOnBehalf(), the staked amount is eventually compared to minStakeAmount, reverting if it’s smaller than that minimum. However, by first calling stake for an amount larger than that minimum and then calling unstake() for almost all of what was staked, a staked position with a dust value would remain without handlePostUnstakeCleanup() being called.
Impact Details
While there’s no immediate impact (beyond increased gas consumption for anyone iterating over those staked positions), it’s not advisable to allow staked positions to hold amounts smaller than the designated minimum. A malicious user could purposely open many dust positions (albeit needing to wait the cooldown period to retrieve the unstaked amounts), potentially using it as a way to spam, incur greater gas costs or cause DoS if it reaches levels beyond the block gas limit.
Severity
While this issue could potentially lead to an impact classified as “Medium” (Unbounded gas consumption), practical limitations together with economic disincentives and a lack of any clear motive for the attacker make it an issue that would be better classified as “Low” (or even an “insight”).
Proof of Concept
{% stepper %} {% step %}
Step
User creates many staked positions from many different addresses for a single validatorId, staking minStakeAmount at a time. {% endstep %}
{% step %}
Step
User unstakes minStakeAmount - 1 from these positions.
{% endstep %}
{% step %}
Step
User withdraws the funds back after the cooling period. {% endstep %}
{% step %}
Step
User repeats the previous steps many times. {% endstep %} {% endstepper %}
<details> <summary>Impact when iterating over stakers list</summary>While a user iterates over:
address[] storage stakersList = $.validatorStakers[validatorId];
the amount of gas consumed can become extremely large, leading to increased costs.
</details>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 unstake function does not check that the remaining staked amount stays above the minimum, and it does not clean up positions that fall below the minimum.
Impact
The increased number of staked positions could raise gas costs for anyone iterating over the staker list and, if the list grows beyond the block gas limit, could cause a denial of service; however, the report notes practical limitations and economic disincentives.
What the attacker needed
Ability to stake at least the minimum amount; wait for the unstake cooldown period; multiple addresses to create many positions
How it was found
- Create many staked positions from different addresses for the same validator, each staking exactly the minimum amount.
- Unstake the minimum amount minus one from each position, leaving a dust amount.
- After the cooldown period, withdraw the unstaked funds.
- Repeat the previous steps many times to accumulate dust positions.
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 smart contract lets people stake tokens, and it says you must stake at least a certain minimum. But you can get around that rule by staking more than the minimum and then taking almost all of it back out, leaving a tiny amount behind. If someone does this many times, the list of stakers becomes huge, and anyone who tries to read that list will spend a lot of gas (the fee paid to run code on the blockchain) and might not be able to do it at all.
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.