Open c4-submissions opened 1 year ago
bytes032 marked the issue as low quality report
We don’t need explicit check for VM version - as this is what the verification keys are used for.
miladpiri (sponsor) disputed
GalloDaSballo changed the severity to QA (Quality Assurance)
QA for operative risk
Lines of code
https://github.com/code-423n4/2023-10-zksync/blob/main/code/contracts/ethereum/contracts/zksync/facets/Executor.sol#L444
Vulnerability details
Impact
The lack of enforcement for the zkSync Era virtual machine version in bootloader processing introduces a security risk. If a bug is discovered and patched in EraVM but operators continue to use the outdated version, vulnerabilities may persist, potentially compromising the security of zkSync transactions.
Proof of Concept
In the process of committing a block, various meta parameters are also committed, including
l2BootloaderBytecodeHash
. This inclusion serves the purpose of ensuring that the batch to be proven contains the correct version of the bootloader. https://github.com/code-423n4/2023-10-zksync/blob/main/code/contracts/ethereum/contracts/zksync/facets/Executor.sol#L55 https://github.com/code-423n4/2023-10-zksync/blob/main/code/contracts/ethereum/contracts/zksync/facets/Executor.sol#L445However, there is a notable absence of mechanisms enforcing the usage of the correct version of the zkSync Era virtual machine when running the bootloader program. For instance, certain simulated opcodes, like
verbatim_3i_0o
, can directly impact the processing of transactions. https://github.com/code-423n4/2023-10-zksync/blob/c3ff020df5d11fe91209bd99d7fb0ec1272dc387/code/system-contracts/bootloader/bootloader.yul#L2464This introduces a potential vulnerability or lack of transparency. For example, if a bug exists in EraVM and is later patched, but an operator continues to run the bootloader with the old version of EraVM (containing the bug), it should not be allowed to be provable on L1. The absence of enforcement in this regard could lead to vulnerabilities or obscurities in the zkSync system.
Tools Used
Recommended Mitigation Steps
The EraVM's version should be embedded within the bootloader for verification on Layer 1.
Assessed type
Context