Hawk High

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

No Fixed School Fees

Summary
The school fees are dynamically set during the initialization of the contract, and there is no fixed or enforced minimum/maximum value. This could lead to inconsistencies or unintended values being set.

Vulnerability Details
Root Cause: The initialize function allows the deployer to set any value for schoolFees without restrictions:

schoolFees = _schoolFees;
Initial State: The contract is deployed, and the initialize function is called.

Step 1: The deployer sets an unintended or extremely low value for _schoolFees.

Outcome: Students can enroll by paying an arbitrary amount, which could lead to insufficient funds for teacher and principal payments.

Implications: The contract may not collect enough funds to sustain operations.

Impact
Who is affected: The school system, teachers, and principal.

How they are affected: Insufficient funds could lead to underpayment or non-payment of teachers and the principal.

Tools Used
manuel review

Recommendations
Enforce a minimum and maximum value for schoolFees during initialization:

if (_schoolFees < MINIMUM_FEES || _schoolFees > MAXIMUM_FEES) {

revert HH__InvalidSchoolFees();

}

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.