Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: high
Valid

Transparent Proxy will not work.

Summary

When user creates a new DAO using the function MembershipFactory:createNewDaoMembership that creates a new TransparentUpgradeableProxy and the owner of that TransparentUpgradeableProxy is set as proxyAdmin , this proxy admin is also a ProxyAdmin contract , so it will block the upgrading functionality.

Vulnerability Details

User can create a new DAO by calling the function MembershipFactory:createNewDaoMembership() and the parameter for the owner of this contract is passed as proxyAdmin which is a Openzeppelin's ProxyAdmin contract getting created in the constructor of the MembershipFactory contract with owner of that ProxyAdmin as the msg.sender.

If we look at the TransparentUpgradeableProxy constructor, using the initialOwner parameter the new ProxyAdmin is deployed, which is the owner of the TransparentUpgradeableProxy.

constructor(address _logic, address initialOwner, bytes memory _data) payable ERC1967Proxy(_logic, _data) {
_admin = address(new ProxyAdmin(initialOwner));
// Set the storage value and emit an event for ERC-1967 compatibility
ERC1967Utils.changeAdmin(_proxyAdmin());
}

So let me explain this complex scenario,

=> Transparent Upgradeable Proxy which sets the admin as ProxyAdmin1 and the admin of the ProxyAdmin1 is ProxyAdmin2 and the owner or the admin of the ProxyAdmin2 is the deployer of the contract MembershipFactory.

So if user wanted to upgrade the implementation contract the call should be go like this
Deployer => ProxyAdmin2 => ProxyAdmin1 => Transparent Upgradeable Proxy

But this call is impossible as there is no way to call ProxyAdmin1 from ProxyAdmin2 contract as ProxyAdmin1 has only 1 function that is

function upgradeAndCall(
ITransparentUpgradeableProxy proxy,
address implementation,
bytes memory data
) public payable virtual onlyOwner {
proxy.upgradeToAndCall{value: msg.value}(implementation, data);
}

And the function signature passed to the proxy is very different from the function signature used here , function called is upgradeToAndCall with 2 parameters while in ProxyAdmin the function upgradeToAndCall is taking 3 parameters so this call will not be made hence upgradation will not be able to take place.

Impact

TransparentUpgradeableProxy will not work breaking the core functionality of the protocol

Tools Used

Manually

Recommendations

Don't pass ProxyAdmin contract while initializing new TransparentUpgradeableProxy contract.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 9 months ago
Submission Judgement Published
Validated
Assigned finding tags:

MembershipERC1155 implementations can not be upgraded for already deployed proxies

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.