Hawk High

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

Permanent Session Lock Due to Missing Session End Function

Summary

Once a session starts, there's no way to end it, permanently locking the contract state.

Vulnerability Details

Root cause:

function startSession(uint256 _cutOffScore) public onlyPrincipal notYetInSession {
inSession = true; // Can never be set back to false
}

Initial State:

  • Session not started (inSession = false)

  • Contract functions normally

Step 1: Principal starts session
Step 2: inSession set to true permanently
Step 3: Contract becomes partially locked

Implications:

  • No new sessions possible

  • Contract functionality limited

  • System becomes unusable

Impact

  • Contract becomes permanently locked

  • New students can't enroll

  • System requires redeployment

Tools Used

Manual Review

Recommendations

Add session end functionality:

function endSession() public onlyPrincipal {
require(block.timestamp >= sessionEnd, "Session still active");
require(inSession, "No active session");
inSession = false;
emit SessionEnded(block.timestamp);
}
Updates

Lead Judging Commences

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