The vulnerability is that the graduateAndUpgrade function can be called by the principal at any time, without checking whether the session has actually ended. This allows the contract to be upgraded and funds to be distributed before the intended session duration is complete, potentially bypassing important business logic or time-based restrictions.
Description:
The graduateAndUpgrade function does not verify whether the current session has ended before allowing the principal to execute the upgrade and distribute funds. As a result, the principal can trigger graduation and contract upgrade at any time, even immediately after starting a session.
Exploit Scenario:
A malicious or careless principal could call graduateAndUpgrade right after starting a session, upgrading the contract and distributing funds before any meaningful activity or review process occurs.
PoC:
The session duration and its intended restrictions can be bypassed.
Students and teachers may not have sufficient time to participate in the session, receive reviews, or meet graduation criteria.
Funds (bursary) can be distributed prematurely, potentially disadvantaging participants who expect the session to last its full duration.
Foundry
Add a check in graduateAndUpgrade to ensure that the current block timestamp is greater than or equal to sessionEnd, enforcing that the session must be completed before graduation and upgrade are allowed.
`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.