Skip to content
Misconfiguration Audit finding Intermediate

Implementation contract AlchemistV3 not locked (_disableInitializers() missing)

The upgradeable implementation contract for AlchemistV3 does not lock its initializers in the constructor, so the implementation address itself could be initialised or reinitialised. The reporter states this is not exploitable today and frames it as a best-practice deviation with future risk.

wylis Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

56350 sc insight implementation contract alchemistv3 not locked disableinitializers missing

Submitted on Oct 14th 2025 at 21:15:54 UTC by @wylis for Audit Comp | Alchemix V3

Description

Brief/Intro

AlchemistV3 is designed for use behind a proxy (tests deploy a TransparentUpgradeableProxy and call initialize(...) via the proxy). The implementation contract uses constructor() initializer {} instead of calling _disableInitializers() in its constructor. While not exploitable today, this is a known upgrade security issue and a deviation from current OpenZeppelin best practice.

Vulnerability Details

OpenZeppelin’s initialization system uses a version number. Each initializer/reinitializer consumes a version so it can’t be run again. The docs say: “The initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused.”

Conventionally, the initializer modifier is the first step and is treated as version 1. Therefore, initializer is effectively equivalent to reinitializer(1). Subsequent upgrades use reinitializer(2), reinitializer(3), etc. Function call _disableInitializers() sets the internal “initialized version” to a terminal state so no initializer or any future reinitializer(n) can ever run on that specific contract instance (the implementation). OpenZeppelin recommends calling it in the implementation’s constructor for proxy-based systems.

Impact Details

This is an Insight for Security best practice (implementation not hard-locked; increased risk of accidental initialization/reinitialization on the implementation address in future versions).

References

https://docs.openzeppelin.com/contracts/5.x/api/proxy#initializable "Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the Initializable._disableInitializers function in the constructor to automatically lock it."

https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#initializing-the-implementation-contract "To prevent the implementation contract from being used, you should invoke the _disableInitializers function in the constructor to automatically lock it"

Proof of Concept

Proof of Concept

Not required for Insights.

The original report as published on Immunefi, by wylis. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the implementation constructor uses the initializer modifier instead of calling _disableInitializers(), leaving the implementation's initializer version open.

Impact

The reporter says this is not exploitable today and only raises the risk of accidental initialisation or reinitialisation of the implementation address in future versions.

What the attacker needed

None today, per the reporter

The fix

The implementation constructor should call _disableInitializers() so the implementation contract is permanently locked.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Upgradeable contracts keep their code in one contract (the implementation) and their data in a separate proxy contract that points at it. The implementation is meant to be set up only once, and a standard safety step locks it so nobody can set it up again. Here that lock is missing, which is a hygiene problem rather than a working attack.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by wylis

View all

4 more disclosed reports, best first.

More from Alchemix V3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.