Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Lack of Invariant Validation in Student Evaluation Flow

Summary

The smart contract designed to manage a student review system lacks proper validation before upgrading a student's level. Specifically, there are no checks to confirm that a student has received the required number of reviews (4) or that they have met the minimum score (cutOffScore) before graduation. This creates a logic flaw that can be exploited to bypass the intended progression system.

Vulnerability Details

In the provided contract:

  • Mentors can submit reviews for students using giveReview().

  • Student data is stored in mappings like studentScore and reviewCount.

  • There is no function that enforces validation of:

    • Total number of reviews per student (== 4)

    • Minimum score (>= cutOffScore)

  • The absence of a function like graduateAndUpgrade() or any validation logic allows:

    • Graduation without completing 4 reviews.

    • Graduation with a score below the defined threshold.

This violates the expected invariants of the system and opens the door to unauthorized upgrades.

Impact

Integrity Violation: Students may graduate without fulfilling academic criteria.

  • Access Control Bypass: The system's trust-based upgrade model is easily abused.

  • Reputation Damage: Undeserving students could receive recognition, damaging the credibility of the system.

  • Financial or Logical Consequences: If graduation or upgrades are tied to benefits (e.g., rewards, certificates, NFTs), this vulnerability could lead to exploitation and unfair resource distribution.

Tools Used

Manual Code Review

Recommendations

  • Implement a graduateAndUpgrade() function with strict validations:

  • Restrict review submission post-deadline by validating block.timestamp <= sessionEnd in giveReview().

Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

cut-off criteria not applied

All students are graduated when the graduation function is called as the cut-off criteria is not applied.

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

cut-off criteria not applied

All students are graduated when the graduation function is called as the cut-off criteria is not applied.

Support

FAQs

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