Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

Storage Collision Risk Between LevelOne and LevelTwo

Summary

Missing __gap and reinitialization risk storage collisions and data corruption.

Vulnerability Details

The LevelOne and LevelTwo contracts use UUPSUpgradeable but lack __gap arrays to reserve storage slots. LevelOne has additional variables (schoolFees, reviewTime, reviewCount, lastReviewTime) not in LevelTwo. Future upgrades (e.g., LevelThree) could overwrite these, causing data corruption. LevelTwo’s graduate also fails to reinitialize critical state.

Impact

Leads to loss of review data or bursary, breaking the system.

Tools Used

Manual storage layout analysis.

Recommendations

Add uint256[50] private __gap; at the end of both contracts. In LevelTwo’s graduate, reinitialize variables like bursary from LevelOne.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

storage collision

Support

FAQs

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