The startSession
function in the LevelOne contract fails to verify that there are enrolled students and registered teachers before initiating an educational session. This allows the principal to create empty sessions that serve no educational purpose, violating the core business logic of the school contract.
The function performs no validation of:
The existence of teachers (listOfTeachers.length > 0
)
The enrollment of students (listOfStudents.length > 0
)
This vulnerability enables the creation of sessions that have no educational participants, bypassing the fundamental purpose of the contract.
While this issue doesn't directly result in fund loss, it allows for:
Bypass of Educational Requirements: The contract's primary purpose is to track and validate educational processes, which is undermined when sessions can exist without teachers or students.
System State Inconsistency: Empty sessions create an illogical state in the system where educational activities are marked as occurring with no participants.
Administrative Process Violation: Even with trusted administrators (principals), this represents a gap in the contract's validation logic that could lead to improper record-keeping.
Downstream Process Disruption: Any processes that rely on session data (such as graduation or reviews) would be operating on invalid assumptions if they interact with empty sessions.
Manual Review
Add validations to ensure that educational sessions can only be started when both teachers and students are present:
While the principal may be a trusted entity, these validations provide guardrails that maintain the logical integrity of the system and prevent accidental misuse.
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.