Hawk High

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

[H-05] Missing Cutoff Score Validation Allows Unqualified Students to Graduate

Summary

The startSession() function fails to enforce a minimum _cutOffScore requirement, coupled with no student score validation in graduateAndUpgrade(). This allows students with failing grades (below 70) to graduate, undermining the educational integrity of the protocol.

Vulnerability Details

Location

  • File: levelOne.sol

  • Functions:

    • startSession(uint256 _cutOffScore)

    • graduateAndUpgrade(address _levelTwo, bytes memory)

Critical Issues

  1. No Minimum Cutoff Enforcement:

    • Current implementation accepts any arbitrary _cutOffScore

  2. Graduation Without Validation:

    • graduateAndUpgrade() processes payments without checking student scores

    • Students could graduate with scores as low as 60 (after 4 failing reviews)

  3. Protocol Logic Flaw:

    • With 4 weekly reviews, maximum possible score reduction is -40 (100 → 60)

    • Without minimum cutoff enforcement, students can fail all reviews and still graduate

Impact

  • Renders the review system meaningless

  • Allows academically unqualified students to graduate

  • Devalues the credentialing system

  • Could lead to protocol reputation damage

Tools Used

  • Manual code analysis

Recommendations

1) Enforce Minimum Cutoff in startSession():

function startSession(uint256 _cutOffScore) public onlyPrincipal notYetInSession {
require(_cutOffScore >= 70, "Cutoff score too low");
sessionEnd = block.timestamp + 4 weeks;
inSession = true;
cutOffScore = _cutOffScore;
emit SchoolInSession(block.timestamp, sessionEnd);
}Add Score Validation in graduateAndUpgrade():

2)Add Score Validation in graduateAndUpgrade():

function graduateAndUpgrade(address _levelTwo, bytes memory) public onlyPrincipal {
// ... existing checks ...
// Validate all students meet cutoff
for (uint256 i = 0; i < listOfStudents.length; i++) {
require(
studentScore[listOfStudents[i]] >= cutOffScore,
"Student below cutoff score"
);
}
// ... payment logic ...
}
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.