code-423n4 / 2022-10-zksync-findings

3 stars 0 forks source link

Missing checks on `initialize` affects getting `l2TokenAddress` and `_governance` #359

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

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 getting l2TokenAddress and _governance

Summary

A wrong assigned address or zero address can lead into incorrect functioning.

PoC

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

c4-sponsor commented 1 year ago

miladpiri marked the issue as disagree with severity

miladpiri commented 1 year ago

Missing zero address check or request for two-step critical address procedure should be at most QA severity!

c4-sponsor commented 1 year ago

miladpiri marked the issue as sponsor acknowledged

c4-judge commented 1 year ago

Duplicate of https://github.com/code-423n4/2022-10-zksync-findings/issues/351

GalloDaSballo commented 1 year ago

L

GalloDaSballo commented 1 year ago

Actually am just closing as over-inflated

c4-judge commented 1 year ago

GalloDaSballo marked the issue as grade-c