Skip to content
DoS Audit finding Intermediate

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.

tansegv Follow

Originally disclosed on Immunefi

  • 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

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
Solidity
// StakingFacet.sol (L428)
function stakeOnBehalf(uint16 validatorId, address staker) external payable returns (uint256) {
    ... 
    _performStakeSetup(staker, validatorId, msg.value); // no consent check
}
Solidity
// 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:
Solidity
// 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:
Solidity
// 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 $.userValidators happens only if no active stake, no active cooldown, and no pending rewards for that validator (PlumeValidatorLogic.sol L113–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 inflated userValidators.
  • 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 minStakeAmount is small, an attacker can cheaply create hundreds of entries. Even with moderate minStakeAmount, 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:

Solidity
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 _processMaturedCooldowns and loops over all entries in $.userValidators[alice].
  • or rewardsFacet.claimAll() → _processAllValidatorRewards loops 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 %}

The original report as published on Immunefi, by tansegv. 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

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

  1. Ensure many active validators exist and minStakeAmount is small.
  2. Victim has normal positions such as a parked balance to withdraw or pending rewards.
  3. Attacker calls stakeOnBehalf with minStakeAmount for many validator IDs, targeting the victim.
  4. Victim calls withdraw or claimAll, which loop over the inflated userValidators array and revert due to gas limits.
  5. 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.

More by tansegv

View all

2 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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.