DOS vulnerability in the expel function at aroun 77K enrolled students. Core invariant "expel students who break rules" could be broken
The DOS vulnerability exists because:
The function iterates through the entire listOfStudents array
There's no limit on how many students can enroll
The gas cost increases linearly with the number of students
The expel function becomes unusable when the number of students grows too large
Principal cannot remove misbehaving students once the array grows too large
Core functionality of the contract becomes unusable
results in
Analysis:
The gas cost increases linearly with the number of students
Given Ethereum's block gas limit of 30M gas, the function would become unusable at around: 77,000 students
manual revie
Add a maximum limit to the number of students that can enroll
Or implement a pagination system for student management and process them in batches
Or use a more gas-efficient data structure like a mapping with a counter
Unbounded loops in student lists could result in high gas usage when trying to expel a students when students are plenty. This could result in a possible DoS
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.