The LevelOne contract implements the UUPS (Universal Upgradeable Proxy Standard) pattern but fails to properly execute the upgrade mechanism in its graduateAndUpgrade function. The function accepts upgrade parameters but does not invoke the actual upgrade functionality from the OpenZeppelin UUPS library, rendering the contract's upgrade functionality broken.
The graduateAndUpgrade function in LevelOne.sol is intended to upgrade the contract to a new implementation (_levelTwo). However, while it calls _authorizeUpgrade(_levelTwo) to verify authorization, it never invokes the actual upgrade function _upgradeToAndCallUUPS provided by the inherited OpenZeppelin UUPSUpgradeable contract.
In the OpenZeppelin implementation, the upgrade process follows this pattern:
However, the LevelOne implementation only performs authorization:
This means that while the contract appears to support upgrades, the actual upgrade mechanism is never triggered.
The vulnerability has several significant impacts:
invariant broken: "At the end of the school session (4 weeks), the system is upgraded to a new one."
Broken Upgradability: The contract cannot be upgraded despite appearing to support upgrades, which will lock the system in its current implementation indefinitely.
False Security Assumption: Users and administrators may falsely believe they can upgrade the contract
Deploy the LevelOne contract
Call graduateAndUpgrade with a valid new implementation address and data
Observe that while the function executes without errors, the contract's implementation remains unchanged
Verify by checking ERC1967Utils.getImplementation() which will still point to the original implementation
Manual code review
Modify the graduateAndUpgrade function to properly call the UUPS upgrade mechanism:
Alternatively, ensure the contract inherits and correctly uses the OpenZeppelin UUPS upgrade pattern by leveraging the existing upgradeToAndCall function directly instead of reimplementing it with graduateAndUpgrade.
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.