Function initialize might be invoked multiple of times. A malicious owner (or the malicious actor who compromised contracts' owner keys) can re-initialize contracts values as many times as he/she wants.
The issue affects three contracts: ArbitrumBranchBridgeAgentFactory.sol, CoreRootRouter.sol, RootPort.sol.
The severity has been estimated as Medium, since malicious owner (likehood: Low) can enforce crucial changes which will break contract (impact: High) by reinitializing its values.
initialize can be run multiple of times. It allows the malicious owner to set new bridgeAgentAddress, bridgeAgentExecutorAddress and hTokenFactoryAddress
Both initialize and initializeCore can be run multiple of times - unless owner runs function forefeitOwnership, which sets _setup to false.
Tools Used
Manual code review
Recommended Mitigation Steps
The main recommendation is to use the modifier initializer.
For ulysses-omnichain/factories/ArbitrumBranchBridgeAgentFactory.sol, the fix could be the same as it's done in ulysses-omnichain/factories/BranchBridgeAgentFactory.sol, where renounceOwnership(); is being added as last instruction inside initialize.
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/factories/ArbitrumBranchBridgeAgentFactory.sol#L54-L65 https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/CoreRootRouter.sol#L63-L67 https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootPort.sol#L128-L155
Vulnerability details
Impact
Function
initialize
might be invoked multiple of times. A malicious owner (or the malicious actor who compromised contracts' owner keys) can re-initialize contracts values as many times as he/she wants.The issue affects three contracts:
ArbitrumBranchBridgeAgentFactory.sol
,CoreRootRouter.sol
,RootPort.sol
.The severity has been estimated as Medium, since malicious owner (likehood: Low) can enforce crucial changes which will break contract (impact: High) by reinitializing its values.
Proof of Concept
initialize
can be run multiple of times.initialize
can be run multiple of times. It allows the malicious owner to set newbridgeAgentAddress
,bridgeAgentExecutorAddress
andhTokenFactoryAddress
Both
initialize
andinitializeCore
can be run multiple of times - unless owner runsfunction forefeitOwnership
, which sets_setup
tofalse
.Tools Used
Manual code review
Recommended Mitigation Steps
The main recommendation is to use the modifier
initializer
. Forulysses-omnichain/factories/ArbitrumBranchBridgeAgentFactory.sol
, the fix could be the same as it's done inulysses-omnichain/factories/BranchBridgeAgentFactory.sol
, whererenounceOwnership();
is being added as last instruction insideinitialize
.Assessed type
Other