The removeTeacher function in the contract lacks a notYetInSession modifier, which is present in the addTeacher function. This oversight allows the principal to remove teachers even after the session has started, potentially causing unfair reward distribution during graduateAndUpgrade processing.
The addTeacher function includes the notYetInSession modifier to prevent teachers from being added once the session is in progress (to ensure fairness and reward accuracy), it does not apply the same constraint on removeTeacher function. This creates an imbalance, where a teacher who has already participated in the session can be removed at the last minute, making them ineligible for compensation fromgraduateAndUpgrade
A malicious principal could exploit this gap by removing a teacher just before the session ends, preventing them from being included in reward or upgrade logic tied to graduateAndUpgrade. This can result in loss of earned compensation for that teacher, undermining trust in the system and potentially leading to disputes or abuse.
Manual Review
Add the notYetInSession modifier to the removeTeacher function to mirror the protection used in addTeacher.
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.