Skip to content
Access control Audit finding Intermediate

VaultController() Missing call DeploymentController.nominateNewDependencyOwner()

The VaultController's setDeploymentController function swaps the stored deployment controller but never calls the old controller's nominateNewDependencyOwner, so ownership of the clone factory and registries is never handed over. As a result, switching to a new deployment controller cannot complete properly.

bin2chen Follow with aashar, ladboy233 and 1 other

Originally disclosed on Code4rena

Submitted by bin2chen, also found by aashar, ladboy233, and chaduke

Unable to switch to a new deploymentController.

Proof of Concept

The current protocol supports the replacement of the new DeploymentController, which can be switched by VaultController.setDeploymentController().

Normally, when switching, the owner of the cloneFactory/cloneRegistry/templateRegistry in the old DeploymentController should also be switched to the new DeploymentController.

DeploymentController’s nominateNewDependencyOwner() implementation is as follows:

  /**
   * @notice Nominates a new owner for dependency contracts. Caller must be owner. (`VaultController` via `AdminProxy`)
   * @param _owner The new `DeploymentController` implementation
   */
  function nominateNewDependencyOwner(address _owner) external onlyOwner {
    IOwned(address(cloneFactory)).nominateNewOwner(_owner);
    IOwned(address(cloneRegistry)).nominateNewOwner(_owner);
    IOwned(address(templateRegistry)).nominateNewOwner(_owner);
  }

But there is a problem here, VaultConttroler.sol does not implement the code to call old_Deployerment.

nominateNewDependencyOwner(), resulting in DeploymentController can not switch properly, nominateNewDependencyOwner()’s Remarks: Caller must be owner. (`VaultController` via `AdminProxy`)

But in fact the VaultController does not have any code to call the nominateNewDependencyOwner:

  function setDeploymentController(IDeploymentController _deploymentController) external onlyOwner {
    _setDeploymentController(_deploymentController);
  }

  function _setDeploymentController(IDeploymentController _deploymentController) internal {
    if (address(_deploymentController) == address(0) || address(deploymentController) == address(_deploymentController))
      revert InvalidDeploymentController(address(_deploymentController));

    emit DeploymentControllerChanged(address(deploymentController), address(_deploymentController));

    deploymentController = _deploymentController;
    cloneRegistry = _deploymentController.cloneRegistry();
    templateRegistry = _deploymentController.templateRegistry();
  }

Recommended Mitigation Steps

setDeploymentController() need call nominateNewDependencyOwner():

contract VaultController is Owned {
  function setDeploymentController(IDeploymentController _deploymentController) external onlyOwner {

+    //1. old deploymentController nominateNewDependencyOwner
+    (bool success, bytes memory returnData) = adminProxy.execute(
+       address(deploymentController),
+       abi.encodeWithSelector(
+         IDeploymentController.nominateNewDependencyOwner.selector,
+         _deploymentController
+       )
+     );
+     if (!success) revert UnderlyingError(returnData);
+
+    //2. new deploymentController acceptDependencyOwnership
+    _deploymentController.acceptDependencyOwnership();

     _setDeploymentController(_deploymentController);
  }

}

RedVeil (Popcorn) confirmed


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

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 setDeploymentController function updates its stored references but omits the call to the old controller's nominateNewDependencyOwner, so dependency ownership is never transferred.

Impact

The deployment controller cannot be switched properly, leaving the protocol unable to complete the replacement.

What the attacker needed

Owner calls setDeploymentController

The fix

setDeploymentController should call nominateNewDependencyOwner on the old controller and acceptDependencyOwnership on the new one before storing it.

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.

A smart contract can have an owner, an address allowed to control it. Here the main contract is meant to pass ownership of some helper contracts to a replacement controller, but the code that does this handover is never called, so the replacement never gains control.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by bin2chen

View all

139 more disclosed reports, best first.

More from Popcorn contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.