Hawk High

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

The contract will upgrade even if students are below the ` cutOffScore`.

Summary

There are no checks if the students are below the cutOffScore, which leads to upgrading these students to the next level.

Vulnerability Details

The invariant says:

Any student who doesn't meet the cutOffScore should not be upgraded

However, the cutOffScore is never checked inside LevelOne::graduateAndUpgrade.

Impact

The protocol will update to Level Two, even if any of the students are below the cutOffScore, which breaks the invariant quoted above. However, this can be preventing by expelling the student. Hence, leaving it as low-severity.

Tools Used

Manual Review

Recommendations

The easiest way is to make a for-loop which will check if all the students are above the cutOffScore. However, remember that for-loops consume a lot of gas.

Updates

Lead Judging Commences

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

cut-off criteria not applied

All students are graduated when the graduation function is called as the cut-off criteria is not applied.

Support

FAQs

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