The Hawk High School smart contract (LevelOne) contains a critical educational governance vulnerability that allows expelled students to immediately re-enroll in the school. This undermines the disciplinary framework of the institution and creates several vectors for academic integrity violations and economic exploitation of the system.
The vulnerability exists in the relationship between the expel() and enroll() functions. When a student is expelled, the contract properly removes them from the current student roster but fails to implement any mechanism to track expelled students or prevent their re-enrollment.
Expulsion Implementation:
The function performs these operations:
Removes the student from the listOfStudents array
Sets isStudent[_student] to false
Emits an Expelled event
Enrollment Implementation:
The enrollment function only checks:
That the enrollment occurs when school is not in session
That the address is not a teacher or principal
That the address is not currently a student
Notably absent is any check for previous expulsion status.
1. Academic Integrity Compromise: The vulnerability enables a cycle where students can:
Perform poorly or receive negative reviews
Get expelled (resetting their academic record)
Re-enroll with a fresh score of 100
Repeat as needed to maintain artificially high scores
2. Economic Exploitation: Each re-enrollment requires payment of school fees, which:
Creates a potential revenue stream from repeated re-enrollments
Distorts the financial model of the school
May create perverse incentives where problematic students become profitable
3. Score Manipulation Mechanics: The contract assigns a perfect score to all new enrollees:
This creates a direct pathway for score manipulation:
A student with a score of 60 after negative reviews
Gets expelled and re-enrolls
Instantly receives a score of 100
Effectively gains +40 points through this manipulation
4. Review System Subversion: The contract implements a review system with time limitations:
But when a student re-enrolls:
Their reviewCount is effectively reset (not explicitly, but the mapping no longer tracks them as having reviews)
Their lastReviewTime record is lost
This permits bypassing review frequency limitations
Attack Steps:
Attacker enrolls as a student during enrollment period
During the school session, they receive multiple negative reviews
Their score drops significantly, potentially below the cutOffScore
They are expelled by the principal
After the session ends, they re-enroll during the next enrollment period
They receive a fresh score of 100 and clean academic record
Code Execution Path:
Approach 1: Expulsion Registry with Permanent Ban
Approach 2: Time-Based Suspension System
Approach 3: Graduated Penalty System For a more nuanced approach that escalates penalties for repeat offenders:
The ability for expelled students to re-enroll represents a fundamental design flaw in the educational governance model implemented by this smart contract. Without addressing this vulnerability, the disciplinary system lacks effectiveness and creates opportunities for manipulation. The implementation of an expulsion tracking system with appropriate re-enrollment restrictions is strongly recommended to maintain the integrity of the Hawk High School system.
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.