(Med) Reinitialization Vulnerability in LevelTwo - LevelTwo contract can be reinitialized by anyone, potentially leading to unexpected behavior or denial of service.
Affected Assets
https://github.com/CodeHawks-Contests/2025-05-hawk-high/blob/main/src/LevelOne.sol#L314
The _authorizeUpgrade
function, which is supposed to check if an upgrade is authorized, is empty. This means that the principal can upgrade the contract to any address without any checks. This allows the principal to set the implementation to a malicious contract.
The _authorizeUpgrade
function in LevelOne.sol
is intended to provide a mechanism for access control during contract upgrades. However, the provided implementation has an empty function body, effectively disabling any authorization checks. This violates the principle of least privilege and opens the door for unauthorized modifications to the contract's logic. The UUPSUpgradeable
pattern relies on this function to prevent malicious upgrades.
Likelihood: High. An attacker who gains control of the principal account can easily exploit this vulnerability.
Business Impact: Critical. The attacker can steal all funds managed by the LevelOne
contract, disrupt the service, and damage the reputation of the school.
Manual Review
AI assistance for code review and analysis
This could involve checking a whitelist of approved upgrade addresses or requiring a multi-signature approval.
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.