Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: high
Invalid

Missing Storage Gap Variable in Base Contract `StakingRewardsPool`

Summary

The StakingRewardsPool contract, serving as a base contract for StakingPool, lacks a storage gap. This omission can lead to storage collision issues in future upgrades, causing data corruption or unexpected behavior across the entire staking system.

Vulnerability Details

The StakingRewardsPool contract is designed as a base contract for StakingPool. It defines several state variables but crucially lacks storage gap:

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/base/StakingRewardsPool.sol#L14

The absence of this gap means that any new variables added in future upgrades of StakingRewardsPool risk overwriting existing storage in StakingPool.

Impact

  1. Future upgrades to StakingRewardsPool that add new state variables will likely overwrite existing storage in StakingPool, leading to severe data corruption.

  2. The behavior of StakingPool may become unpredictable after an upgrade, directly threatening user funds and the integrity of the entire staking system.

  3. It effectively prevents safe upgrades to the base StakingRewardsPool contract, severely limiting the protocol's ability to evolve and fix potential issues.

Tools Used

Manual Review
This missing storage gap is NOT mentioned in the provided known issues.

Recommendations

Add storage gap variable after all of the storage variables to the StakingRewardsPool contract:

+ uint256[50] _gap
Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.