The LevelOne contract exhibits an inconsistent security pattern between similar administrative functions. While the expel() function explicitly requires the school to be in session, the removeTeacher() function lacks this contextual validation check. This inconsistency introduces a vulnerability where teachers can be removed during active sessions, potentially disrupting the educational process.
The unrestricted ability to remove teachers during active sessions can have several negative consequences:
Disruption of the review process, as fewer teachers would be available to provide required student reviews
Potential inability to meet the invariant that "students must have gotten all reviews before system upgrade"
Academic process integrity compromised if teachers are removed before completing their duties
This issue depends on principal actions but presents a moderate risk due to:
No technical barrier preventing teacher removal during active sessions
No warning or indication to the principal that removing teachers mid-session may be problematic
The natural administrative workflow might reasonably include teacher adjustments at any time
The contract implements two similar administrative functions with inconsistent security models:
The inconsistency reveals a logical flaw in the contract's design:
expel() can only be called when inSession == true
removeTeacher() can be called regardless of session state
Both functions affect the core participants in the educational process
This discrepancy suggests either:
An oversight in implementing consistent session state validation
A deliberate but undocumented design decision that lacks clear rationale
Given the educational context of the contract and the requirement for teachers to provide reviews, allowing teacher removal during active sessions contradicts the operational needs of the system.
Consider this sequence of events:
School session starts with 3 teachers and 30 students
Each teacher is responsible for reviewing 10 students over 4 weeks
After week 2, the principal calls removeTeacher() on one teacher
The remaining 2 teachers now must review additional students
If the remaining teachers cannot handle the increased workload, some students may not receive all 4 required reviews
System upgrade becomes impossible due to unmet review requirements
The security model should be consistent between administrative functions. Two potential fixes:
Option 1: Match the expel() function's model (preferred):
Option 2: Match the addTeacher() function's model:
Either approach would establish a consistent security model across administrative functions, preventing potential disruption to the educational process by ensuring teacher management occurs at appropriate times.
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.