code4rena-2022-11-blur-exchange-m04

[M-04] Pool designed to be upgradeable but does not set owner, making it un-upgradeable

보고서

Summary

컨트랙트가 UUPSUpgradeable이지만, 컨트랙트를 초기화하지 않아 owner가 없고, 이에 의해 _authorizeUpgradeonlyOwner modifier를 통과하지 못해 업그레이드할 수 없다.

Keyword

uups, upgradeable, ownable, initialize error

Vulnerability

contract Pool is IPool, OwnableUpgradeable, UUPSUpgradeable {
    function _authorizeUpgrade(address) internal override onlyOwner {}
    ...
}

Pool 컨트랙트는 UUPSUpgradeable이지만, initialize 함수가 존재하지 않는다. OwnableUpgradeable을 상속하지만 초기화하지 않으므로 owner도 설정되지 않는다.

UUPS 업그레이드를 위한 _authorizeUpgrade 함수에는 onlyOwner modifier가 붙어있다. 하지만 owner가 존재하지 않아 업그레이드가 불가하다.

Impact

Pool컨트랙트는 업그레이더블로 구현되었지만 실제로 업그레이드가 불가하다.

Mitigation

initialize 함수를 추가하고 owner를 초기화한다.


tags: bughunting, blur exchange, smart contract, solidity, nft marketplace, uups, upgradeable, initialize error, severity medium