A critical vulnerability was identified in the graduateAndUpgrade function where USDC payments are processed after contract upgrades, risking incorrect fund distribution due to stale bursary values.
Location:
graduateAndUpgrade(address _levelTwo, bytes memory) function
Technical Description:
The function currently performs:
Contract upgrade (_authorizeUpgrade)
USDC payments to teachers/principal
This order creates two risks:
Stale bursary Value: Payments use pre-upgrade bursary amount even if upgrade modifies it
Upgrade Failure: If upgrade reverts, payments may never execute despite meeting requirements
Attack Vectors:
Malicious upgrade could front-run payment logic
Upgrade could accidentally modify bursary before payments complete
Potential Consequences:
Financial losses from incorrect payment amounts
Fund locking if upgrade reduces bursary before payments
Protocol insolvency if payments use inflated old values
Loss of stakeholder trust
Worst Case Scenario:
An attacker could propose an upgrade that:
Reduces bursary by 90% during upgrade
Lets payments execute at old 100% rate
Steals the 90% difference
The system doesn't implement UUPS properly.
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.