(HIGH) Unprotected Upgrade Function - Unauthorized contract upgrade leading to potential arbitrary code execution
Affected Asset
https://github.com/CodeHawks-Contests/2025-05-hawk-high/blob/main/src/LevelOne.sol#L314
The _authorizeUpgrade
function, which is supposed to restrict who can upgrade the contract, is empty. This means anyone can upgrade the contract to a malicious implementation, effectively taking control of the contract and any funds it holds. The graduateAndUpgrade
function calls _upgradeToAndCall
which uses the _authorizeUpgrade
function. Because _authorizeUpgrade
is empty, it does not prevent anyone from upgrading the contract.
Likelihood of Exploitation: High. The absence of access control on the upgrade function makes the contract extremely vulnerable. An attacker could easily deploy a malicious contract and upgrade the LevelOne contract, leading to complete control.
Manual Review
AI Assistance report writting
Implement Access Control: In the _authorizeUpgrade
function, check if the caller is the authorized upgrade administrator.
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.