Hawk High

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

Missing Student Upgrade Logic in LevelOne Contract

Summary

The graduateAndUpgrade function in LevelOne.sol fails to implement the core functionality of upgrading students to LevelTwo, leaving students stranded in LevelOne even after meeting graduation requirements.

Vulnerability Details

function graduateAndUpgrade(address _levelTwo, bytes memory) public onlyPrincipal {
if (_levelTwo == address(0)) {
revert HH__ZeroAddress();
}
uint256 totalTeachers = listOfTeachers.length;
uint256 payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION;
uint256 principalPay = (bursary * PRINCIPAL_WAGE) / PRECISION;
_authorizeUpgrade(_levelTwo);
// Lack of student progression management!
for (uint256 n = 0; n < totalTeachers; n++) {
usdc.safeTransfer(listOfTeachers[n], payPerTeacher);
}
usdc.safeTransfer(principal, principalPay);
}
  • No transfer of student data to LevelTwo contract

  • No interface implementation with LevelTwo contract

  • No student status updates

  • Current implementation only handles teacher payments and contract upgrade

Impact

High: This vulnerability:

  • Breaks the core educational progression system

  • Prevents students from advancing to LevelTwo

  • Leaves student data stranded in the old contract

  • Makes the upgrade process incomplete

  • Could lead to financial losses for students who paid fees

Tools Used

Manual code review

Recommendations

Add student upgrade logic to graduateAndUpgrade:

  • Implement proper student data transfer

  • Create and implement interface with LevelTwo contract

  • Add events to track student graduation

Updates

Lead Judging Commences

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