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

3 stars 0 forks source link

Missing checks on `setVerifier` can make `proveBlocks` work in unexpected behaviors until `governor` notices and fixes it #357

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/zksync/facets/Executor.sol#L260 https://github.com/code-423n4/2022-10-zksync/blob/5a31c9db8ab32175dbd7264b05ce84931b6c0428/ethereum/contracts/zksync/facets/Governance.sol#L94-L100

Vulnerability details

Missing checks on setVerifier can make proveBlocks work in unexpected behaviors until governor notices and fixes it

Summary

In setVerifier, _newVerifier address is assigned with no 0 checks, if wrongly assigned two scenarios posibles:

https://github.com/code-423n4/2022-10-zksync/blob/5a31c9db8ab32175dbd7264b05ce84931b6c0428/ethereum/contracts/zksync/facets/Executor.sol#L260

Github Permalinks

https://github.com/code-423n4/2022-10-zksync/blob/5a31c9db8ab32175dbd7264b05ce84931b6c0428/ethereum/contracts/zksync/facets/Governance.sol#L94-L100

Mitigation

Check zero address before assigning or using it

c4-sponsor commented 1 year ago

miladpiri marked the issue as sponsor disputed

miladpiri commented 1 year ago

Any wrong address can have the same impact, not specifically only address(0). So, this is an invalid issue!

c4-judge commented 1 year ago

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

GalloDaSballo commented 1 year ago

Downgrading to QA Low by convention, agree with the Sponsor that any wrong address can cause issues

L