Missing initializer protection enables potential initialization hijacking
Upgradeable StakingContract implementation is missing _disableInitializers() in its constructor, leaving the implementation contract initializable directly via the proxy pattern.
Description
This issue was raised during the mitigation period while reviewing F-2025-0007.
The upgradeable StakingContract implementation is missing the _disableInitializers() call in its constructor.
When using the transparent proxy pattern with OpenZeppelin's upgradeable contracts, the implementation contract should have its initializers disabled to prevent attackers from directly initialising the implementation contract (not the proxy).
Without this protection, an attacker could potentially:
- Call
initialize()directly on the implementation contract. - Set themselves as the owner of the implementation.
- Potentially cause confusion or interfere with proxy operations.
Recommendation
Add a constructor that disables initializers:
/// @custom:oz-upgrades-unsafe-allow constructorconstructor() {_disableInitializers();}
Resolution
Ample Protocol: Fixed.
Zealynx: Verified.

