LevelOne.sol:graduateAndUpgrade()
should work only if the following
conditions are satisfied :
Students must have gotten all reviews before system upgrade. System upgrade should not occur if any student has not gotten 4 reviews (one for each week)
Any student who doesn't meet the cutOffScore
should not be upgraded
System upgrade cannot take place unless school's sessionEnd
has reached
LevelOne.sol:graduateAndUpgrade()
will execute successfully without validating the above conditions. This allows the graduateAndUpgrade()
function to run even before the requirements are satisfied.
Here is the vulnerable code:
It lacks the following validations
Students must have received all four weekly reviews before the upgrade.
Students below the cutOffScore
threshold should not be upgraded.
The upgrade must not occur before the school's sessionEnd
.
Here is the Proof Of Code :
place this test in LevelOneAndGraduateTest.t.sol and run it
System can be upgraded even if the school's sessionEnd
has not reached
All the students even who did not meet the cutOffScore
will be upgraded
System can be upgraded even before not getting all the 4 reviews
Manual analysis
Foundry
Implement the valid checks in LevelOne.sol:graduateAndUpgrade()
as specified below
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
`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.