Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

We can able to enroll even if the session is not started

summary

We can able to enroll even if the session is not started

vulnerability details

We are using LevelOne::notYetInSession as wrongly at many places . This modifier is only suitable for the function LevelOne::startSession as this checks for if the session has already been started or not and this is not suitable for other functions

POC

function testModifer() public {
LevelOne levelOneImplementation = new LevelOne();
vm.startPrank(clara);
levelOneImplementation.initialize(principal, schoolFees, address(usdc));
usdc.approve(address(levelOneImplementation), schoolFees);
levelOneImplementation.enroll();
vm.stopPrank();
}

impact - High

likelyhood - High

Recommendations

we need to have a modifier like this and need to replace it with the LevelOne::notYetInSession modifer usages in the below functions

-> LevelOne::enroll

-> LevelOne::addTeacher

modifier isSessionStarted() {
if (inSession == false) {
revert HH__SessionHaventStarted();
}
_;
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Too generic

Appeal created

lucky2892000 Submitter
about 1 month ago
lucky2892000 Submitter
about 1 month ago
yeahchibyke Lead Judge
about 1 month ago
yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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