Unbounded Array Return in View Functions Leads to Gas Limit DoS
The getListOfStudents()
and getListOfTeachers()
functions return complete arrays data of all list of student and teacher, potentially causing out-of-gas errors when lists grow large.
Root cause:
Initial State:
Contract deployed with empty student/teacher lists
Lists grow as users are added
Step 1: Lists grow beyond gas block limits
Step 2: View functions attempt to return full arrays
Step 3: Transactions revert due to out-of-gas errors
Implications:
Frontend applications fail to load data
Contract becomes partially unusable
High gas costs for users
Frontend applications unable to fetch complete lists
Potential DoS of critical contract functionality
Excessive gas costs for users
Reduced contract usability
Manual Review
Implement pagination:
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.