The giveReview
function in the LevelOne contract doesn't validate that the _student
parameter is not the zero address (0x0) before proceeding with operations. While there's a check for whether the address is a registered student, an explicit zero address check would provide an additional layer of validation.
While the function includes a check that the address is a registered student (isStudent[_student]
), which would typically catch zero address issues, explicit validation is a defensive programming best practice.
The vulnerability has low severity because:
The existing check if (!isStudent[_student])
would likely catch any zero address inputs, as address(0) shouldn't be a registered student
The function is protected by the onlyTeacher
modifier, limiting who can call it
No direct fund transfers occur in this function
manual review
Add an explicit zero address check at the beginning of the function:
This follows the same validation pattern used in other functions in the contract and maintains code consistency.
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.