Hawk High

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

Lack of Handling for Positive Reviews Prevents Student Score Improvement

Summary

LevelOne::giveReview function fails to handle positive reviews, which means student scores can only decrease. This prevents fair score evaluation and restricts students from improving their performance metrics within the system.

Vulnerability Details

In the current implementation of the review system, only negative reviews are handled within the `giveReview` function. When a teacher submits a review, the logic only accounts for reducing the student’s score. There is no conditional logic or state update to reflect a positive review, such as increasing the student’s score or marking progress.

POC:

Add the code at the top of LevelOneAndGraduateTest.t.sol.

event ReviewGiven(address indexed student, bool indexed review, uint256 indexed studentScore);

after that add the function in the same file.

function testOnlyNegativeReivewWorks() public schoolInSession {
vm.warp(block.timestamp + 1 weeks);
vm.expectEmit(true, true, true, false);
emit ReviewGiven(harriet,true,100);
vm.prank(alice);
levelOneProxy.giveReview(harriet, true);
}

Impact

The lack of handling for positive reviews means students' scores can only decrease, preventing any possibility of score recovery or improvement. As a result:

  • Students may be unfairly blocked from graduating, even after receiving multiple positive reviews.

  • The system becomes unbalanced and biased, leading to poor user experience and potential loss of trust in the platform.


Tools Used

Foundry- Manual Testing

Recommendations

Complete the if statement with following code.

if (!review) {
studentScore[_student] -= 10;
} else {
studentScore[_student] += 10;
}

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.