Hawk High

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

L-02.The principal can add himself as a teacher

Summary

The principal can add himself as a teacher by calling 'addTeacher`

Vulnerability Details

Contrary to `enroll`, the function does not revert if the argument _teacheris the principal address.

Impact

The princiapl will receive a part of the fees distributed to teacher in graduateAndUpgrade

The impact is low because even if the function revert, the principal can still bypass the check by providing another address managed by him.

Tools Used

Manual analysis

Recommendations

Add the same check as for enroll

if (msg.sender == principal) {
revert HH__NotAllowed();
}

Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

principal can become teacher

Principal can add themselves as teacher and share in teacher pay upon graduation

Support

FAQs

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