Hawk High

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

[EVMN-HH11] Unbounded Student Scores

Summary

Vulnerability Details

The giveReview() function decreases the score without a lower bound, allowing scores to go negative. This could lead to unexpected behavior or errors.

// where `false` is a bad review and true is a good review
if (!review) {
studentScore[_student] -= 10;
}

Impact

Impact: Medium - Could cause unintended student penalties or system errors.

Likelihood: Low - Depends on review distribution but possible over time.

Tools Used

Manual review

Recommendations

Add a check to prevent scores from dropping below zero.

// In giveReview function
int256 newScore = studentScore[_student] - 10;
if (newScore < 0) {
newScore = 0;
}
studentScore[_student] = newScore;
Updates

Lead Judging Commences

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

Support

FAQs

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