Hawk High

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

Teacher Removal Allows Potential Abuse by Principal

Summary

The removeTeacher() function lacks any access controls related to the academic season. The principal can remove teachers:

  • After they have started working (mid-season).

  • Without settling compensation.

  • In bulk (even more than half), breaking continuity and quality of education.

Vulnerability Details

function removeTeacher(address _teacher) public onlyPrincipal {
if (_teacher == address(0)) {
revert HH__ZeroAddress();
}
if (!isTeacher[_teacher]) {
revert HH__TeacherDoesNotExist();
}
uint256 teacherLength = listOfTeachers.length;
for (uint256 n = 0; n < teacherLength; n++) {
if (listOfTeachers[n] == _teacher) {
listOfTeachers[n] = listOfTeachers[teacherLength - 1];
listOfTeachers.pop();
break;
}
}
isTeacher[_teacher] = false;
emit TeacherRemoved(_teacher);
}

Impact

Unpaid labor from teachers.

Tools Used

manual review

Recommendations
introduce a system where:

  • Teachers cannot be removed mid-season.

  • If removed, automatic partial compensation is issued.

  • Limit max number of removals per season.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 2 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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