Hawk High

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

Principal can set favorable and unfavorable `cutOffScore` for students in `LevelOne::startSession`

Summary

As it stands, the system is built for the maximum score of a student to be 100, since a bad review deducts 10. The principal can set a score above 100 to ensure that no student passes, since there's no range check.

Impact

No student passes even if they get good reviews for all 4 weeks.

Tools Used

Manual Review

Recommendations

Add a range check for cut-off score provided by the principal:

function startSession(
uint256 _cutOffScore
) public onlyPrincipal notYetInSession {
+ require(_cutOffScore >=70 && _cutOffScore <=100, "Invalid cut off score");
sessionEnd = block.timestamp + 4 weeks;
inSession = true;
cutOffScore = _cutOffScore; // there should be a range check for this
emit SchoolInSession(block.timestamp, sessionEnd);
}

Updates

Lead Judging Commences

yeahchibyke Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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