this is a chained bug, where i didn't stop at proving that the owner can remove/fire teachers while session is running, i also chained it with the bug i reported here https://codehawks.cyfrin.io/c/2025-05-hawk-high/s/cma5krvko0003l50445xs8kol, leaving us with a high impact where the owner can take a complete 40% of all the school fees for only theirselves.
1- Navigate to test/LeveOnelAndGraduateTest.t.sol
file
2- Add the following PoC code to the test
file:
3- in the command line, run the following command: forge test --match-test testIfOwnerCanFireATeacherWhileSessionIsOn -vvv
4- the output will be as following :
the impact of this bug is the Principal
can steal all the wage of all teachers for theirself, and instead of taking a 5% of all schook fees as the protocol rules, the Principal
will secure a complete 40% of all the school fees which is a critical flaw.
Manual Recon
foundry test suite
Add the LevelOne::notYetInSession
modifier with the LevelOne::removeTeacher
function as the following:
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.