Hawk High

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

In `LevelOne` there is no function or way to set `LevelOne:inSession` to false after session end, enabling teachers to review after session end

Description: In LevelOne contract inSession variable is set to true in LevelOne:startSession and LevelOne:sessionEnd is setted from whatever time the startSession started plus four weeks. But after the four weeks end there is no way to set insession variable to false to prevent teacher from LevelOne:giveReview to students after time is up.

Vulnerability Details: variable inssession is not set to false after sessionEnd reached

Impact: teachers can call giveReview function after sessionEnd

Tools Used: Manual Review

Proof of Concept: Add this test suit to your LeveOnelAndGraduateTest.t.sol code

Proof of Code
function test_confirm_can_give_review_After_Session_End() public schoolInSession {
vm.warp(block.timestamp + 5 weeks);
vm.roll(block.number + 1);
vm.prank(alice);
levelOneProxy.giveReview(harriet, false);
assert(levelOneProxy.studentScore(harriet) == 90);
assert(levelOneProxy.getSessionStatus() == true);
assert(block.timestamp > levelOneProxy.getSessionEnd());
}

Recommendations: There are multiple ways to mitigate this:
1. Make a function that can be called after sessionEnd to set inSession to false
2. Use Decentralized oracle Chainlink Upkeep to set inSession to false immediatly after session end

Updates

Lead Judging Commences

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