Skip to content

Latest commit

 

History

History
43 lines (21 loc) · 2.08 KB

009.md

File metadata and controls

43 lines (21 loc) · 2.08 KB

Plain Cream Kookaburra

Medium

Missing Constructor with _disableInitializers() in Contract ArmirX.sol

Summary

Contract AmirX.sol lacks a constructor that calls _disableInitializers(). This omission is a vulnerability in the context of upgradeable contracts, where not disabling the initializers on the implementation contract can lead to potential misuse and security risks.

When creating an upgradeable contract, the implementation contract (the base version of the contract) should not be directly initialized. However, without _disableInitializers() in a constructor, anyone could call an initializer function directly on the implementation contract and potentially gain control of sensitive functions or data. This could lead to unauthorized control over the contract’s state or business logic.

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

  1. Security Risk of Unauthorized Initialization: Without _disableInitializers(), malicious actors could potentially call an initializer function on the implementation contract, setting themselves as privileged roles (e.g., admin or owner).
  2. Loss of Control: An attacker who gains access to initialize the contract could lock out legitimate administrators or take control over sensitive functions, leading to asset loss or other critical issues within the contract.

PoC

No response

Mitigation

According to OpenZeppelin’s documentation, calling _disableInitializers() in the constructor of the implementation contract prevents this issue. It effectively disables any initialization functions for the implementation contract, enforcing that only the proxy instance (the deployed instance) can be initialized. This ensures that the logic contract is protected from being initialized and having its state altered.