Description: LevelOne::removeTeacher
lacks the 'notYetInSession' modifier. A malicious or mistaken principal can remove teachers in the middle of an active session.
Impact: If all teachers are removed mid-session, LevelOne::graduateAndUpgrade
will compute 'totalTeachers == 0', causing a division-by-zero or a zero-teacher payout—either way, graduation will revert and funds lock up.
Proof of Concept:
Note: this PoC assumes that the 'Incorrect Teacher-Pay Calculation' issue has already been fixed, so that graduateAndUpgrade gets as far as splitting by totalTeachers instead of reverting earlier.
After this fix include the following test in the LevelOneAndGraduateTest.t.sol
file:
Recommended Mitigation: Add 'notYetInSession' to 'removeTeacher':
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.