Skip to content
Business logic Audit finding Intermediate

`autoDeployedVault` mapping is not updated after `unregisterOperatorVault`

The unregisterOperatorVault function removes a vault from the operator's vault lists but does not clear the _autoDeployedVault mapping in the OpNetVaultAutoDeploy extension. As a result, the operator's auto-deployed vault address remains recorded, so the system believes the operator still has a vault and will not create a new one, while the old vault is no longer registered.

0xShoonya Follow with snjax and zark

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-06-symbiotic-relay-judging/issues/362

Found by

0xShoonya, snjax, zark

Summary

unregisterOperatorVault deletes a vault in VotingPowerProvider but it doesn't check the _autoDeployedVault mapping in OpNetVaultAutoDeploy extension, so an operator whose auto-deployed vault is removed remains flagged as owning that vault and can neither receive a fresh auto deployment nor rely on the old address.

Root Cause

The vault unregistration in VotingPowerProviderLogic updates only _operatorVaults and _allOperatorVaults. When the vault had originally been created by OpNetVaultAutoDeploy.createVault, its address was also stored in _autoDeployedVault[operator]. Because unregisterOperatorVault is not overridden in the extension and holds no hook back into it, that mapping key is left unchanged.

Solidity
// OpNetVaultAutoDeploy.sol
    function _registerOperatorImpl(
        address operator
    ) internal virtual override {
        super._registerOperatorImpl(operator);
        if (isAutoDeployEnabled() && getAutoDeployedVault(operator) == address(0)) {
            (address vault, address delegator,) = OpNetVaultAutoDeployLogic.createVault(operator);
            _registerOperatorVault(operator, vault);
            if (isSetMaxNetworkLimitHookEnabled()) {
                ISetMaxNetworkLimitHook(NETWORK()).setMaxNetworkLimit(
                    delegator, SUBNETWORK_IDENTIFIER(), type(uint256).max
                );
            }
        }
    }

Link to code

Solidity
// VotingPowerProviderLogic.sol
    function unregisterOperatorVault(address operator, address vault) public {
        IVotingPowerProvider.VotingPowerProviderStorage storage $ = _getVotingPowerProviderStorage();
        if (!$._operatorVaults[operator].remove(Time.timestamp(), vault)) {
            revert IVotingPowerProvider.VotingPowerProvider_OperatorVaultNotRegistered();
        }
        $._allOperatorVaults.remove(Time.timestamp(), vault);

        emit IVotingPowerProvider.UnregisterOperatorVault(operator, vault);
    }

Link to code

So after all, calls to getAutoDeployedVault(operator) therefore return a vault that the core module now considers unregistered, and _registerOperatorImpl skips auto-deployment because it sees a non-zero pointer.

Internal Pre-conditions

Auto deployment must be enabled, the configuration valid and an operator has previously registered, triggering createVault and populating _autoDeployedVault.

External Pre-conditions

unregisterOperatorVault(operator, vault) being invoked for that vault created with auto deployment.

Attack Path

  1. An operator registers while auto-deployment is enabled, causing createVault to store vault in _autoDeployedVault[operator] and register it in the provider storage.
  2. A caller executes unregisterOperatorVault(operator, vault), which removes the vault from _operatorVaults and _allOperatorVaults but leaves _autoDeployedVault[operator] unchanged.
  3. Because getAutoDeployedVault(operator) still returns a non-zero address, the system assumes the operator already has a vault and skips creating a new one, while the active vault lists no longer include that old address. Also, if someone queries the getAutoDeployedVault of the operator, an incorrect unregistered vault would be returned.

Impact

The impact of this issue is that the OpNetVaultAutoDeploy::getAutoDeployedVault of the operator would return an incorrect unregistered vault while in the same time the operator would never be able to create a new auto deployed vault.

PoC

N/A

Mitigation

In order to mitigate this code "asymmetry", it is recommended to overwrite the _unregisterOperator in OpNetVaultAutoDeploy (as it is done with the _registerOperatorImpl) and if the operator and the vaults matches in _autoDeployedVault, then unregister it from there as well.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/symbioticfi/relay-contracts/pull/33/commits/84fa428dbd8b113c56f92bf91481997d6eedc288

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

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 unregisterOperatorVault function in VotingPowerProviderLogic does not clear the _autoDeployedVault mapping in the OpNetVaultAutoDeploy extension, leaving a stale address.

Impact

The operator's getAutoDeployedVault returns an incorrect unregistered vault, and the operator can never create a new auto-deployed vault.

What the attacker needed

Auto-deployment enabled; operator previously registered with auto-deploy; unregisterOperatorVault called for that vault

The fix

The protocol team fixed this issue by overriding _unregisterOperator in OpNetVaultAutoDeploy to clear the _autoDeployedVault mapping when the operator and vault match.

How it was found

  1. An operator registers while auto-deployment is enabled, causing createVault to store the vault in _autoDeployedVault[operator] and register it in the provider storage.
  2. A caller executes unregisterOperatorVault(operator, vault), which removes the vault from _operatorVaults and _allOperatorVaults but leaves _autoDeployedVault[operator] unchanged.
  3. Because getAutoDeployedVault(operator) still returns a non-zero address, the system assumes the operator already has a vault and skips creating a new one, while the active vault lists no longer include that old address.

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.

When an operator registers, the system can automatically create a vault for them and remember its address. If that vault is later unregistered, the system forgets it in one place but not in the auto-deploy record. So the operator is stuck: the system thinks they already have a vault and won't make a new one, but the old vault is no longer valid.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0xShoonya

View all

8 more disclosed reports, best first.

More from Symbiotic Relay

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.