#39873 [BC-Critical] Lack of validation of node activation time in `InitRewardTimes` allows to steal rewards

Submitted on Feb 9th 2025 at 16:42:27 UTC by @Blockian for Audit Comp | Shardeum: Core III

  • Report ID: #39873

  • Report Type: Blockchain/DLT

  • Report severity: Critical

  • Target: https://github.com/shardeum/shardeum/tree/bugbounty

  • Impacts:

    • Direct loss of funds

Description

Impact

User can falsely get very large rewards by reporting a false nodeActivatedTime in an InitRewardTimes transaction.

Root Cause

The validation of InitRewardTimes lacks validation that nodeActivatedTime is within bounds of the staking / active period of the node.

Attack Flow

  • A node stakes and becomes active in the network

  • The node calls InitRewardTime with a very small nodeActivatedTime (for example: 1)

  • The node finishes being active

  • The node calls ClaimReward with its actual deactivation time

  • The reward is calculated according to the fake nodeActivatedTime

  • The node calls Ustake and receives all the reward

Suggested Fix

  • Validate nodeActivatedTime

Severity

This allows to mint extremely large amounts of the native token, and so is critical.

Proof of Concept

Proof of Concept

In the POC you can see a user staking and claiming rewards with a very small nodeActivatedTime and receiving rewards for the entire (fake) period.

  1. Apply the following changes on Shardeum

  1. Run a json-rpc-server

  2. Run the following attack script:

Was this helpful?