According to the documentation, the system upgrade should not occur if the school's session end date has not been reached.
System upgrade cannot take place unless school's
sessionEnd
has reached
However, thegraduateAndUpgrade
function does not validate the session end date before upgrading the contract.
The vulnerability is located in the graduateAndUpgrade
function of the LevelOne
contract.
There is no validation for the session end date before upgrading the contract. This means that the contract can be upgraded before the session end date has been reached, which is a violation of the documentation.
The existing test test_confirm_can_graduate
can be used to confirm this vulnerability. The test tries to upgrade the contract but has no warp statement to simulate the passage of time.
This test should fail according to the documentation but it does not.
Since the teachers and principal are paid on system upgrade, this can lead to teachers and the principal being paid before the session end date has been reached.
Manually reviewed the code and the documentation.
The graduateAndUpgrade
function should be changed to validate the session end date before upgrading the contract. This can be done by adding a require statement to check if the session end date has been reached before upgrading the contract.
`graduateAndUpgrade()` can be called successfully even when the school session has not ended
`graduateAndUpgrade()` can be called successfully even when the school session has not ended
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.