Description:
The graduateAndUpgrade() function in the LevelOne contract is vulnerable to complete failure if any teacher or the principal has been blacklisted by the USDC token contract. The function uses SafeERC20's safeTransfer to distribute payments to all teachers in a loop and then to the principal. If any recipient address is blacklisted by the USDC token, the transfer will revert, causing the entire transaction to fail. This creates a critical vulnerability where a single blacklisted address can prevent the entire contract upgrade process from completing.
Code Snippet:
Impact: This vulnerability creates a significant risk to the contract's operation and longevity:
The contract upgrade mechanism becomes completely blocked if any single teacher is blacklisted
USDC funds remain locked in the contract indefinitely
The school system cannot progress to a new implementation
The principal cannot remove the problematic teacher after the upgrade attempt has started
A malicious actor could intentionally get themselves added as a teacher and then get blacklisted to sabotage the system
Proof of Concept:
A teacher's address gets blacklisted by the USDC token (could happen for various compliance reasons)
The principal attempts to call graduateAndUpgrade() with a valid new implementation address
When the function attempts to transfer USDC to the blacklisted teacher, the transaction reverts
The contract remains in its current implementation, and all funds stay locked
Recommended Mitigation: Implement a pull payment pattern instead of push payment, separating the upgrade logic from the payment distribution:
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.