Skip to content
Business logic Audit finding Intermediate

Lack of initialization check in staking allows users to stake without reward token configured, causing permanent loss of yield

The staking contract allows users to stake before any reward token is configured, so their positions accrue zero rewards. When a reward token is added later, reward accrual only starts from that point, permanently losing all yield for the earlier staking period.

wylis Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

52248 sc insight lack of initialization check in staking allows users to stake without reward token configured causing permanent loss of yield

Submitted on Aug 9th 2025 at 00:27:51 UTC by @wylis for Attackathon | Plume Network

Description

Intro

The protocol has no safeguard to ensure a reward token is configured before staking is allowed. If addRewardToken is not called during manual deployment, users can stake successfully but will accrue zero rewards. Because reward accrual only begins from the timestamp of the first reward token checkpoint, any staking period before that point results in permanent and unrecoverable yield loss, even if the admin fixes the configuration later.

Vulnerability Details

During setup, the ADMIN_ROLE must configure the Rewards facet and reward treasury by adding at least one reward token and funding the treasury. An example of the required initialization is:

Solidity
RewardsFacet(address(diamondProxy)).addRewardToken(
    PLUME_NATIVE,
    PLUME_REWARD_RATE_PER_SECOND,
    PLUME_REWARD_RATE_PER_SECOND * 2
);
treasury.addRewardToken(PLUME_NATIVE);
vm.deal(address(treasury), 1_000_000 ether);

{% stepper %} {% step %}

Reward rate remains zero

In PlumeRewardLogic.updateRewardPerTokenForValidator(), the loop over rewardTokens never runs, and no rewards are accrued. {% endstep %}

{% step %}

Distribution calls revert

When PlumeStakingRewardTreasury.distributeReward() is called:

Solidity
if (!_isRewardToken[token]) {
    revert TokenNotRegistered(token);
}

Since _isRewardToken[token] is false, the function reverts and no rewards are paid. {% endstep %}

{% step %}

Permanent loss of historical yield

When a reward token is later added, createRewardRateCheckpoint sets the start time to block.timestamp. There is no retroactive calculation, so all rewards that would have accrued before that point are lost forever.

Because there is no “initialized” flag or gating logic in StakingFacet::stake, users can enter positions in a non-earning state without warning. {% endstep %} {% endstepper %}

Impact Details

{% hint style="warning" %}

  • Impact: Loss of yield — users permanently lose rewards for the entire period between staking and reward token configuration.
  • Likelihood: High for manual deploys without automated scripts, especially if multiple admin steps are involved.
  • Magnitude: Potentially affects 100% of protocol TVL if all stakers enter before reward token is added; all missed yield is unrecoverable.
  • Secondary effects: User trust erosion, broken reward distribution automation, increased support overhead. {% endhint %}

Link to Proof of Concept

https://gist.github.com/wylis-hodor/625f336084af3fe8265a3dbdad1b17bd

Proof of Concept

{% stepper %} {% step %}

Deploy protocol

Admin deploys diamond facets and core contracts. {% endstep %}

{% step %}

Initialize without adding a reward token

Admin runs setup steps but omits:

  • RewardsFacet.addRewardToken()
  • PlumeStakingRewardTreasury.addRewardToken()
  • Funding the treasury {% endstep %}

{% step %}

User stakes

User calls stake(); funds are accepted, and validator stake is recorded. No revert occurs. {% endstep %}

{% step %}

Rewards accrue at zero rate

In updateRewardPerTokenForValidator(), the empty rewardTokens array causes no updates; pending rewards remain zero. {% endstep %}

{% step %}

Distribution fails

If the treasury attempts to distribute rewards, TokenNotRegistered is thrown. {% endstep %}

{% step %}

Reward token added later

Admin calls addRewardToken() at time T1. Rewards start accruing only from T1 onward; yield from time of stake until T1 is lost permanently. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by wylis. 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 staking function lacks a check that at least one reward token has been configured, and reward accrual only begins from the first reward token checkpoint.

Impact

Users permanently lose all rewards for the period between staking and reward token configuration, potentially affecting all staked funds, though no principal is lost.

What the attacker needed

Manual deployment without reward token setup; user stakes before reward token added

The fix

The staking function should be gated so it reverts until at least one reward token has been configured.

How it was found

  1. Admin deploys the diamond facets and core contracts.
  2. Admin runs setup but omits adding a reward token and funding the treasury.
  3. User calls stake(); funds are accepted and validator stake is recorded without revert.
  4. Rewards accrue at zero rate because the rewardTokens array is empty.
  5. If the treasury tries to distribute rewards, it reverts with TokenNotRegistered.
  6. Admin adds a reward token later; rewards start only from that time, losing earlier yield.

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 over time. Here, the contract never checks that a reward token has been set up before accepting stakes, so early users earn nothing. Even after the admin adds the reward token, the missed rewards from before are gone forever.

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 wylis

View all

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