Closed code423n4 closed 1 year ago
miladpiri marked the issue as sponsor disputed
Any wrong address can have the same impact, not specifically only address(0). So, this is an invalid issue!
Downgrading to QA Low by convention, agree with the Sponsor that any wrong address can cause issues
L
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 makeproveBlocks
work in unexpected behaviors untilgovernor
notices and fixes itSummary
In
setVerifier
,_newVerifier
address is assigned with no 0 checks, if wrongly assigned two scenarios posibles:s.verifier.verify_serialized_proof(proofPublicInput, _proof.serializedProof);
will call a function that in_newVerifier
doesn't existverify_serialized_proof
and returns wrong booleans, leading to accepting unexpected blocks or not accepting expected ones. This would be really edge case but harmful as it don't revert and some blocks would get proved until someone notices.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