Platform: Code4rena
Start Date: 07/10/2022
Pot Size: $50,000 USDC
Total HM: 4
Participants: 62
Period: 5 days
Judge: 0xean
Total Solo HM: 2
Id: 169
League: ETH
Rank: 3/62
Findings: 1
Award: $4,328.22
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: ladboy233
Also found by: csanuragjain
https://github.com/code-423n4/2022-10-thegraph/blob/main/contracts/gateway/BridgeEscrow.sol#L21
The implementation contract can initialize the _controller address multiple times on Managed contract even though it should only be allowed once. Ideally only existing controller should be allowed to decide the new controller but this can be used to bypass the controller power.
Changing controller should only be allowed via setController function
function initialize(address _controller) external onlyImpl { Managed._initialize(_controller); }
function _initialize(address _controller) internal { _setController(_controller); } function _setController(address _controller) internal { require(_controller != address(0), "Controller must be set"); controller = IController(_controller); emit SetController(_controller); }
function setController(address _controller) external onlyController { _setController(_controller); }
Use the initializer modifier on the initialize function making it callable once only
#0 - trust1995
2022-10-16T00:44:40Z
Dup of #149 . Precondition likely too much of a stretch for a M finding, although definitely worth fixing.