Summary
principal receives 5% of the bursary.
teachers receive 35% of the bursary.
Due to two small vulnerabilities in the project, when combined, the principal can end up receiving 40% of the total fund allocation.
Vulnerability Details
Vulnerability 1:
In the addTeacher function, due to a lack of strict restrictions, the principal can add themselves as a teacher.
Specifically, listOfTeachers[0] = Principal.
Vulnerability 2:
In the graduateAndUpgrade function, due to an error in the following code:
This results in the total teacher salary payPerTeacher being transferred entirely to listOfTeachers[0].
Conclusion:
So if listOfTeachers[0] = Principal, the principal will receive (35% + 5%) of the total fund allocation!
POC
Not written.
Recommendations
Fix for graduateAndUpgrade:
Fix for addTeacher:
Principal can add themselves as teacher and share in teacher pay upon graduation
`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.
Principal can add themselves as teacher and share in teacher pay upon graduation
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.