Hawk High

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

Storage collision in contracts LevelOne and LevelTwo

Summary

Contract LevelTwo has storage layout different from contract LevelOne, and this leads to unexpected values loaded from storage.

Vulnerability Details

Storage variable schoolFees was removed in contract LevelTwo. This changes the storage layout and now variables listOfTeachers and listOfStudents used in contract LevelTwo store values from slots corresponding to another variables in contract LevelOne, and that leads to unexpected values that return these variables.

Impact

Changed storage layout leads to unexpected contract behavior.

Tools Used

Manual review

Recommendations

Keep all storage variables from contract LevelOne in the same order in contract LwvelTwo.

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.