Vulnerability · Published Oct 25, 2023 · Assigned by GitHub_M
CVE-2023-46232era-compiler-vyper First Immutable Variable Initialization vulnerability
Medium 5.3
In plain English
A medium-severity security flaw in era-compiler-vyper from matter-labs. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 53% of all known vulnerabilities).
Official description
era-compiler-vyper is the EraVM Vyper compiler for zkSync Era, a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum. Prior to era-compiler-vype version 1.3.10, a bug prevented the initialization of the first immutable variable for Vyper contracts meeting certain criteria. The problem arises when there is a String or Array with more 256-bit words allocated than initialized. It results in the second word’s index unset, that is effectively set to 0, so the first immutable value with the actual 0 index is overwritten in the ImmutableSimulator. Version 1.3.10 fixes this issue by setting all indexes in advance. The problem will go away, but it will get more expensive if the user allocates a lot of uninitialized space, e.g. `String[4096]`. Upgrading and redeploying affected contracts is the only way of working around the issue.
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| matter-labs | era-compiler-vyper | < 1.3.10 |
Weakness: CWE-471 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
References
- https://github.com/matter-labs/era-compiler-vyper/security/advisories/GHSA-h8jv-969m-94r4 x_refsource_CONFIRM
- https://github.com/matter-labs/era-compiler-vyper/commit/8be305a1b9c68d0fd47dad3434224ed85944ca25 x_refsource_MISC
- https://github.com/matter-labs/era-system-contracts/blob/main/contracts/ImmutableSimulator.sol#L37 x_refsource_MISC