Open hats-bug-reporter[bot] opened 9 months ago
Please describe how thebehavior of the contracts would differ from the intended behavior, where common sense would not apply.
Many of the reports are also known. See audit by Veridise.
@reednaa, From CatalystChainInterface.sol
contract, we know that the code checks for require(address(GARP_) != address(0)); // dev: GARP_ cannot be zero address
, meaning that protocol team are aware that some parameters need zero address checks, however they forget to check also that require(address(defaultOwner) != address(0));
, if defaultOwner
address ever got set to address(0)
, it is equivalent to renounceOwnership()
function from Ownable.sol
. As a result, all functions with onlyOwner
modifier set cannot be called successfully forever. With that being said, I think zero address checks are necessary.
The owner address is dangerous in all of the contracts. They can cause the protocol to behave in unintended ways or even drain the vaults.
Setting the owner to address(0) seems like a feature rather than a bug.
@reednaa Yes I totally agree with your point, but the thing is it's in constructor, all the variables are still not yet initialized. For instance, if address(0)
is directly passed in to the CatalystChainInterface.sol
's constructor, all the setters such as CatalystChainInterface.sol::setMinGasFor
, CatalystChainInterface.sol::setMaxUnderwritingDuration
and CatalystChainInterface.sol::connectNewChain
will never be able to call successfully. If the intention is to set owner's address to address(0)
, renounceOwnership()
function should be used instead.
setMaxUnderwritingDuration
does not need to be called but you can make a case for the other 2. Let me discuss internally but I am leaning won't fix.
Github username: @erictee2802 Twitter username: 0xEricTee Submission hash (on-chain): 0xf646b2d965867a74bd44065300b9ca07c9f31ecab9afe46b1aa70766252bf3b7 Severity: low
Description: Description\
constructors lacks zero address validation:
OnRecvIncentivizedMockEscrow.sol:
Missing zero address check for
MESSAGING_PROTOCOL_CALLER
.IncentivizedWormholeEscrow.sol:
Missing zero address check for
wormhole_
. (Note: check for zero address for parameter sendLostGasTo in IncentivizedMessageEscrow.sol).IncentivizedMessageEscrow.sol:
Missing zero address check for
sendLostGasTo
.CatalystChainInterface.sol:
Missing zero address check for
defaultOwner
.CatalystFactory.sol:
Missing zero address check for
defaultOwner
.CatalystVaultCommon.sol:
Missing zero address check for
factory_
&mathlib
.Attack Scenario\
Since parameter of costructor are used to initialize state variable which are used in other function of the contract, error in these state variable can lead to redeployment of contract.
Attachments
NA
Proof of Concept (PoC) File
NA
Revised Code File (Optional)
It is recommended to add zero address validation.