The LevelOne contract fails to enforce session end boundaries in the giveReview function, creating an "eternal review period" where teachers can continue modifying student scores indefinitely after a session has officially ended.
The LevelOne contract implements a school session system with a clear start and end:
However, while the sessionEnd variable is set, the giveReview function does not check whether the current time has exceeded this boundary:
This stands in stark contrast to other functions like expel, which explicitly check whether the session is active:
This vulnerability has severe implications for the contract's intended behavior:
Infinite Review Window: Teachers can continue giving reviews weeks, months, or even years after a session has ended
Graduation Ceremony Disruption: If the graduateAndUpgrade function relies on final student scores, these scores can be manipulated right before graduation
Inconsistent State Management: The contract has an ambiguous state where students can't enroll (due to inSession being true) but teachers can still modify scores after the session should be closed
Contract Lifecycle Violation: The intended lifecycle of start session → conduct reviews → end session → graduate is broken
Unpredictable Final Scores: Students cannot know when their final score is actually "final"
The contract maintains two session-related state variables:
The giveReview function should check both that the session is active (inSession == true) and that the current time is before the session end (block.timestamp <= sessionEnd):
Principal calls startSession with _cutOffScore = 70
sessionEnd is set to block.timestamp + 4 weeks
After 4 weeks pass and sessionEnd is reached, teachers can still call giveReview
Even if the principal is preparing to call graduateAndUpgrade, teachers can still modify student scores
A teacher could give negative reviews to students who would have passed the cutoff score, causing them to fail just before graduation
Implement proper session boundary enforcement in the giveReview function by adding these checks:
Additionally, consider adding functionality to properly close a session when sessionEnd is reached, transitioning the contract to a state where reviews are no longer possible but graduation processing can occur.
`inSession` not updated after during upgrade
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.