Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: medium
Likelihood: high
Invalid

(Med) Reinitialization Vulnerability in LevelTwo - LevelTwo contract can be reinitialized by anyone, potentially leading to unexpected behavior or denial of service.

Summary

(Med) Reinitialization Vulnerability in LevelTwo - LevelTwo contract can be reinitialized by anyone, potentially leading to unexpected behavior or denial of service.

Vulnerability Details

Affected Assets

https://github.com/CodeHawks-Contests/2025-05-hawk-high/blob/main/src/LevelOne.sol#L314

function _authorizeUpgrade(address newImplementation) internal override onlyPrincipal {}

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.

Impact

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.

Tools Used

  1. Manual Review

  2. AI assistance for code review and analysis

Recommendations

This could involve checking a whitelist of approved upgrade addresses or requiring a multi-signature approval.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Appeal created

xyizko Submitter
4 months ago
yeahchibyke Lead Judge
4 months ago
yeahchibyke Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.