Closed code423n4 closed 1 year ago
miladpiri marked the issue as disagree with severity
Missing zero address check or request for two-step critical address procedure should be at most QA severity!
miladpiri marked the issue as sponsor acknowledged
L
Actually am just closing as over-inflated
GalloDaSballo marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2022-10-zksync/blob/5a31c9db8ab32175dbd7264b05ce84931b6c0428/ethereum/contracts/bridge/L1ERC20Bridge.sol#L79-L82
Vulnerability details
Missing checks on
initialize
affects gettingl2TokenAddress
and_governance
Summary
A wrong assigned address or zero address can lead into incorrect functioning.
PoC
_governor
and_l2TokenFactory
not checked https://github.com/code-423n4/2022-10-zksync/blob/5a31c9db8ab32175dbd7264b05ce84931b6c0428/ethereum/contracts/bridge/L1ERC20Bridge.sol#L79-L82If wrongly assigned
_l2TokenFactory
,l2TokenAddress()
will not work as expected affecting possibility of getting the l2 token address for a l1 deposit.Also the
_governor
is used as function parameter without any check, and therefore, if a 0 address is used,_governor
address role would be a lost role and all the functions valid only for_governor
role will be blocked.Mitigation
l2TokenFactory
in case of error or track the deployment and logs for being able to redeploy without affecting the protocol reputationmsg.sender
for_governor
address and then transfer it with a double step method as defined inGovernance.sol
contract