Incorrect initializer modifier in Vesting contract prevents proper initialization
The Vesting contract's initializer function uses the `initializer` modifier instead of `onlyInitializing`, so when inherited by SymmVesting, only one of the two initializers can run. This prevents the inheriting contract from completing initialization, potentially blocking deployment of critical protocol components.
Source: https://github.com/sherlock-audit/2025-03-symm-io-stacking-judging/issues/86
Found by
0xBecket, 0xDemon, ChaosSR, Drynooo, Greed, Hackoor, LonWof-Demon, Ragnarok, The_Rezolvers, Uddercover, ZoA, anchabadze, durov, edger, justAWanderKid, n1ikh1l, octopus_testjjj, t0x1c
Description:
In the Symmio protocol, the Vesting contract is designed to be inherited by SymmVesting. However, the __vesting_init() function in Vesting uses the initializer modifier instead of the onlyInitializing modifier:
// Vesting.sol
function __vesting_init(address admin, uint256 _lockedClaimPenalty, address _lockedClaimPenaltyReceiver)
public
initializer
{
__AccessControlEnumerable_init();
__Pausable_init();
__ReentrancyGuard_init();
// ...rest of initialization...
}
Meanwhile, in the inheriting contract: https://github.com/sherlock-audit/2025-03-symm-io-stacking/blob/main/token/contracts/vesting/SymmVesting.sol#L55
// SymmVesting.sol
function initialize(
address admin,
address _lockedClaimPenaltyReceiver,
address _pool,
// ...other parameters...
) public initializer {
// ...checks...
__vesting_init(admin, 500000000000000000, _lockedClaimPenaltyReceiver);
// ...additional initialization...
}
According to OpenZeppelin's documentation and best practices, the initializer modifier should only be used in the final initialization function of an inheritance chain, while initialization functions of parent contracts should use the onlyInitializing modifier. This ensures proper initialization when using inheritance.
When both parent and child contracts use the initializer modifier, only one of them can actually complete initialization, as the modifier sets a flag that prevents any subsequent calls to functions with the initializer modifier.
Impact:
The vulnerability causes a significant operational issue, preventing inheriting contracts from completing initialization. This could lead to a failure in the deployment of critical protocol components, affecting the overall system functionality.
Recommended Mitigation:
Change the initializer modifier to onlyInitializing in the parent contract:
// In Vesting.sol
function __vesting_init(address admin, uint256 _lockedClaimPenalty, address _lockedClaimPenaltyReceiver)
public
- initializer
+ onlyInitializing
{
__AccessControlEnumerable_init();
__Pausable_init();
__ReentrancyGuard_init();
// ...rest of initialization...
}
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/SYMM-IO/token/pull/2/files
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 parent contract's initialization function uses the `initializer` modifier instead of `onlyInitializing`, which conflicts with the child contract's own `initializer` modifier.
Impact
The inheriting contract cannot complete initialization, which could lead to a failure in the deployment of critical protocol components.
What the attacker needed
None
The fix
The issue was fixed by changing the `initializer` modifier to `onlyInitializing` in the parent contract.
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.
Smart contracts can inherit from other contracts, like a child contract building on a parent. Each contract may have an initialization function to set things up once. If both parent and child use a lock that only allows one initialization, the second one fails, so the child contract never gets fully set up.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.