Hawk High

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

Missing Review Count Check in graduateAndUpgrade

Summary

Absence of a 4-review check in graduateAndUpgrade allows upgrades with incomplete reviews, violating the 4-review invariant.

Vulnerability Details

The graduateAndUpgrade function in LevelOne.sol does not verify that each student has received exactly 4 reviews before initiating an upgrade, despite the invariant requiring all students to have 4 reviews. Combined with the missing increment of reviewCount (Issue #1), this allows upgrades to proceed with incomplete review cycles, compromising the system's integrity.

Impact

Permits invalid upgrades, potentially graduating students without proper evaluation.

Tools Used

Manual code review and Foundry testing.

Recommendations

Add a loop in graduateAndUpgrade to check require(reviewCount[listOfStudents[i]] == 4, "All students must have 4 reviews"); for each student before proceeding with the upgrade.

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.