Hawk High

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

There is no check for `LevelOne::cutOffScore` on students who are qualified to graduate, this breaks one of the invariants

**Description:** One of the invariants states `Any student who doesn't meet the `cutOffScore` should not be upgraded`. However this check is not made on the `LevelOne::graduateAndUpgrade`
**Impact:** This allows any student to graduate even without passing the cutoffscore
**Proof of Concept:**
1. Add teachers
2. Enroll students
3. Start session
4. Upgrade and graduate without checking students cutoffscore
<details>
<summary> Proof of Code </summary>
Add the following in the `LevelOneAndGraduateTest.t.sol`
```js
function test_cant_upgrade_without_all_reviews() public schoolInSession {
vm.warp(block.timestamp + 4 weeks);
levelTwoImplementation = new LevelTwo();
levelTwoImplementationAddress = address(levelTwoImplementation);
bytes memory data = abi.encodeCall(LevelTwo.graduate, ());
vm.prank(principal);
levelOneProxy.graduateAndUpgrade(levelTwoImplementationAddress, data);
}
```
</details>
**Tools Used** Manual Review and Foundry
**Recommended Mitigation:** Use `cutOffScore` to add a check on the `graduateAndUpgrade` function to ensure that only students who pass the cutOffScore graduate
Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month 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.