Hawk High

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

[H-08] Vulnerability Report: Missing Session End Check in `LevelOne::graduateAndUpgrade`

Summary

The graduateAndUpgrade function allows system upgrades without verifying the school session has officially ended, directly contradicting protocol specifications. This violates the core requirement that:

  • "System upgrade cannot take place unless school's sessionEnd has reached"

  • "At the end of the school session (4 weeks), the system is upgraded to a new one"

Vulnerability Details

Affected Code

function graduateAndUpgrade(address _levelTwo, bytes memory) public onlyPrincipal {
if (_levelTwo == address(0)) {
revert HH__ZeroAddress();
}
// Missing: require(block.timestamp >= sessionEnd, "Session ongoing");
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);
}

Key Issues

1) Missing Temporal Validation:

  • No check that block.timestamp >= sessionEnd before upgrade

  • Allows premature system upgrades during active session

2) Protocol Specification Violations:

  • Contradicts documentation stating upgrades must wait for session completion

Impact

1) Financial Risks:

  • Premature fund distribution before session completion

2) Protocol Integrity:

  • Students could be upgraded without completing requirements

  • System state transitions occur outside designated timeframe

Tools Used

  • Manual Review

Recommendations

  • Add Temporal Validation:

require(block.timestamp >= sessionEnd, "Session not ended");
Updates

Lead Judging Commences

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

session state not updated

`inSession` not updated after during upgrade

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

session state not updated

`inSession` not updated after during upgrade

Support

FAQs

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