Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

Missing _disableInitializers() calling in the implementations' constructor

Summary && Vulnerability Details

The contracts which are implementations that the proxies will point to, should call _disableInitializers() in their constructor but they are not doing it .

Impact

it is vulnerable to unintended initialization of the implementation (logic) contract, which can break upgradeability and corrupt future proxy deployments.

Tools Used

OpenZeppelin UUPS contracts

Recommendations

Adding _disableInitializers() would help mitigate this risk by locking the initializer functions.

/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers(); // constructors are not used in upgradeable contracts. this is best practice to prevent initializers from happening in the constructor
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge 17 days ago
Submission Judgement Published
Validated
Assigned finding tags:

contract can be re-initialized

The system can be re-initialized by an attacker and its integrity tampered with due to lack of `disableInitializer()`

Support

FAQs

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