Hawk High

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

Missing sessionEnd Check in graduateAndUpgrade

Summary

Missing sessionEnd check enables premature upgrades, violating the 4-week session invariant.

Vulnerability Details

The graduateAndUpgrade function in LevelOne.sol does not check if block.timestamp >= sessionEnd before upgrading, despite the invariant requiring a 4-week session. This allows the Principal to upgrade the system prematurely, breaking the session duration rule.

Impact

Disrupts the scheduled session timeline, affecting all actors.

Tools Used

Manual code review and Foundry testing.

Recommendations

Add require(block.timestamp >= sessionEnd, "Session has not ended"); at the start of graduateAndUpgrade.

Updates

Lead Judging Commences

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

can graduate without session end

`graduateAndUpgrade()` can be called successfully even when the school session has not ended

Support

FAQs

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