Hawk High

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

Missing Storage Gap in `UUPSUpgradeable` Contract May Cause Storage Collisions

Summary

The UUPSUpgradeable contract does not include a reserved storage gap (__gap), which is critical for ensuring upgradeable contract safety. This omission can lead to storage collisions when new variables are added in future implementations, potentially overwriting existing storage and introducing unexpected behavior.

Impact

Without a reserved storage gap, any newly added state variables in upgraded implementations may overlap with storage slots used by the inherited contracts. This can corrupt contract state, break logic, or introduce vulnerabilities that are hard to detect.

Recommendation

Add a fixed-size storage gap at the end of the contract, as recommended by OpenZeppelin's UUPSUpgradeable pattern. For example:

uint256[50] private __gap;

This allows for future upgrades without risking storage conflicts.

References

Tools Used

  • Manual Review

Updates

Lead Judging Commences

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

storage collision

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.