Hawk High

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

Missing check for reviewCount in graduateAndUpgrade() __LevelOne.sol

Summary

The graduateAndUpgrade function assumes that each student has received the required 4 reviews but does not enforce this via a require check.

Vulnerability Details

The absence of a check on reviewCount allows students to graduate without completing all required reviews, violating the system’s invariant:

System upgrade should not occur if any student has not gotten 4 reviews (one for each week)

This opens a logic flaw where under-reviewed students can be considered complete.

function graduateAndUpgrade(address _levelTwo, bytes memory) public onlyPrincipal {
if (_levelTwo == address(0)) {
revert HH__ZeroAddress();
}
// require(block.timestamp >= sessionEnd, "Session has not ended yet");
uint256 totalTeachers = listOfTeachers.length;
uint256 payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION;
uint256 principalPay = (bursary * PRINCIPAL_WAGE) / PRECISION;
_authorizeUpgrade(_levelTwo);
for (uint256 n = 0; n < totalTeachers; n++) {
usdc.safeTransfer(listOfTeachers[n], payPerTeacher);
}
usdc.safeTransfer(principal, principalPay);
}

Impact

Students could be upgraded without completing all reviews

Compromises the integrity of the upgrade/graduation mechanism

Tools Used

Manual review

Recommendations

Inside graduateAndUpgrade()add a check to ensur every student has exactly 4 reviews:

for (uint256 i = 0; i < listOfStudents.length; i++) {
require(reviewCount[listOfStudents[i]] == 4, "Not all students fully reviewed");
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge 19 days 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.

yeahchibyke Lead Judge 19 days 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.