Hawk High

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

Teacher can manipulate the review and score of students .

Summary

In function giveReview in contract levelOne . Teacher can manipulate the score of students by giving them false review .

Vulnerability Details

In function giveReview in contract levelOne . Teacher can manipulate the score of students by giving them false review .

https://github.com/CodeHawks-Contests/2025-05-hawk-high/blob/3a7251910c31739505a8699c7a0fc1b7de2c30b5/src/LevelOne.sol#L285


if (!review) { // q teacher can give bad review and deduct the score and can alter class result
studentScore[_student] -= 10;
}
function giveReview(address _student, bool review) public onlyTeacher {
if (!isStudent[_student]) {
revert HH__StudentDoesNotExist();
}
require(reviewCount[_student] < 5, "Student review count exceeded!!!");
require(block.timestamp >= lastReviewTime[_student] + reviewTime, "Reviews can only be given once per week");
// where `false` is a bad review and true is a good review
if (!review) {
studentScore[_student] -= 10;
}
// Update last review time
lastReviewTime[_student] = block.timestamp;
emit ReviewGiven(_student, review, studentScore[_student]);
}

Impact

Teacher can alter the class result according to their wish . Making some student get benifit from this. If total student is 5 and teacher give false review to 4 student , then 5th student will get the benifit .

Tools Used

Manual review

Recommendations

Make the review giving automatic , by storing the previous data or by scored marks .

Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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