Unconsented stakeOnBehalf enables third-party gas-griefing DoS by bloating userValidators, breaking withdraw/claimAll
Anyone can call stakeOnBehalf to add a validator to a victim's userValidators list without consent. By spraying many validators with tiny stakes, an attacker can make the victim's withdraw, claimAll, and restakeRewards calls loop over a huge array and run out of gas, freezing access to funds.
- Disclosed after under an hour
53051 sc high unconsented stakeonbehalf enables third party gas griefing dos by bloating uservalidators breaking withdraw claimall
Submitted on Aug 14th 2025 at 18:10:58 UTC by @tansegv for Attackathon | Plume Network
- Report ID: #53051
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol
- Impacts:
- Permanent freezing of funds
- Theft of gas
- Unbounded gas consumption
Description
Because anyone can stakeOnBehalf(staker) and permanently append distinct validators to a victim’s userValidators, and many public flows iterate that array, an attacker can force the victim’s operations (withdrawals, claims, restakes) to consume unbounded gas and revert, freezing access to funds.
stakeOnBehalf lets any external account fund a stake for someone else. The first stake with a validator appends that validator ID to the victim’s $.userValidators. Core user actions (withdraw, claimAll, reward calculations, cooldown processing) loop over this entire list. A malicious actor can “spray” the victim across many validators with tiny stakes (≥ minStake), inflating loop work until calls OOG/revert, causing a liveness DoS of user funds.
Vulnerability Details
- Unconsented association & list growth
// StakingFacet.sol (L428)
function stakeOnBehalf(uint16 validatorId, address staker) external payable returns (uint256) {
...
_performStakeSetup(staker, validatorId, msg.value); // no consent check
}
// PlumeValidatorLogic.sol (L58-L66)
function addStakerToValidator(..., address staker, uint16 validatorId) internal {
if (!$.userHasStakedWithValidator[staker][validatorId]) {
$.userValidators[staker].push(validatorId); // grows victim's list
$.userHasStakedWithValidator[staker][validatorId] = true;
}
...
}
- Hot paths iterate
$.userValidators[user]- Cooldown & withdraw:
// StakingFacet.sol (L855)
uint16[] memory userAssociatedValidators = $.userValidators[user];
for (uint256 i = 0; i < userAssociatedValidators.length; i++) { ... }
// called by withdraw() (L395) and restakeRewards() (L451)
- Rewards & claims:
// RewardsFacet.sol (L537)
uint16[] memory validatorIds = $.userValidators[user];
for (uint256 i = 0; i < validatorIds.length; i++) { ... } // used by claimAll()
- Pruning is hard to trigger
Removal from$.userValidatorshappens only if no active stake, no active cooldown, and no pending rewards for that validator (PlumeValidatorLogic.solL113–L141). An attacker who keeps tiny stakes outstanding (and never unstakes) effectively pins those entries. - Asymmetry
Attacker cost per validator =minStakeAmount(configurable; can be very small). Victim pays ongoing extra gas (O(N)) forever. With enough validators, the loops exceed the block gas limit → revert.
Impact Details
- Primary impact: Liveness DoS of user funds — the victim cannot successfully:
withdraw()parked native (after cooldown processing),claimAll()rewards,restakeRewards(...),
whenever looped processing runs out of gas due to inflateduserValidators.
- Scope: Per-user targeted; no privileged roles required.
- Persistence: Lasts as long as attacker’s tiny stakes remain ≥
minStakeAmount. Victim could try to unwind validator-by-validator, but that’s expensive and time-consuming (cooldowns, per-validator interactions), while the DoS persists during each attempt. - Economics: If
minStakeAmountis small, an attacker can cheaply create hundreds of entries. Even with moderateminStakeAmount, this is a griefing vector (attacker spends once; victim pays gas tax forever).
Proof of Concept
{% stepper %} {% step %}
Setup
Ensure there are many active validators (as in production). minStakeAmount > 0 (as required by code), but keep it small to minimize attacker cost.
{% endstep %}
{% step %}
Victim pre-state
Alice has normal positions (e.g., some cooled “parked” balance to withdraw or pending rewards to claim). {% endstep %}
{% step %}
Attack
Mallory iterates over a large set of validator IDs and calls:
stakingFacet.stakeOnBehalf{value: minStakeAmount}(validatorId, alice);
This appends each validatorId to $.userValidators[alice] and leaves a tiny stake outstanding.
{% endstep %}
{% step %}
Trigger DoS
Alice now tries:
stakingFacet.withdraw()→ enters_processMaturedCooldownsand loops over all entries in$.userValidators[alice].- or
rewardsFacet.claimAll()→_processAllValidatorRewardsloops through all entries.
With enough spray, gas usage exceeds block limits → revert. {% endstep %}
{% step %}
Persistence
Because Mallory’s tiny stakes are still > 0, the cleanup path does not prune entries. Alice’s calls continue to revert until she individually unwinds those stakes across many validators (expensive and slow), or the protocol patches the logic. {% 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 stakeOnBehalf function allows unconsented additions to a user's validator list, and core functions iterate that unbounded list without a cap or pruning mechanism.
Impact
The victim cannot withdraw parked native funds, claim rewards, or restake rewards because the calls revert from unbounded gas consumption, and the denial of service lasts as long as the attacker's tiny stakes remain.
What the attacker needed
Many active validators; small minStakeAmount; attacker can pay minStakeAmount per validator; victim has funds or rewards to withdraw
The fix
The protocol should require consent for stakeOnBehalf or cap and prune the userValidators list so that core functions cannot be forced to iterate an unbounded array.
How it was found
- Ensure many active validators exist and minStakeAmount is small.
- Victim has normal positions such as a parked balance to withdraw or pending rewards.
- Attacker calls stakeOnBehalf with minStakeAmount for many validator IDs, targeting the victim.
- Victim calls withdraw or claimAll, which loop over the inflated userValidators array and revert due to gas limits.
- The tiny stakes remain, so cleanup does not prune entries and the denial of service persists.
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 keeps a list of validators for each user. A function lets anyone add a validator to someone else's list by staking a tiny amount on their behalf. If an attacker adds hundreds of validators, the victim's normal actions have to check every entry and may run out of gas, so they cannot withdraw or claim rewards.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.