era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- No fix listed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA.
Summary
era-compiler-solidity is the ZKsync compiler for Solidity. The problem occurred during instruction selection in the `DAGCombine` phase while visiting the XOR operation. The issue arises when attempting to fold the expression `!(x cc y)` into `(x !cc y)`. To perform this transformation, the second operand of XOR should be a constant representing the true value. However, it was incorrectly assumed that -1 represents the true value, when in fact, 1 is the correct representation, so this transformation for this case should be skipped. This vulnerability is fixed in 1.4.1.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| matter-labs | era-compiler-solidity | 1.2.0 – 1.4.0 | — | No fix listed | CNA |
- era-compiler-solidity Vendormatter-labs Affected 1.2.0 – 1.4.0 Fixed in — No fix listed CNA
CPE names CISA-ADP · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:matter-labs:era-compiler-solidity:1.2.0:*:*:*:*:*:*:* | 1.2.0 | — | matter-labs |
- cpe:2.3:a:matter-labs:era-compiler-solidity:1.2.0:*:*:*:*:*:*:* Versions 1.2.0 — ·matter-labs
Remediation
No fixed version listed by the sources yet.
Timeline
- 2026-10-02 Threatist record created from CVE-2024-34704
References
More matter-labs vulnerabilities
- TI-2024-29017 zkvyper ignored loop range bounds CVSS 3.1CRITICAL 9.1
- TI-2024-30167 `fold (xor (shl 1, x), -1) -> (rotl ~1, x)` misoptimization in zksolc CVSS 3.1MEDIUM 5.9
- TI-2024-25768 ZKsync Era invalid stack addressing conversion CVSS 3.1MEDIUM 6.5
- TI-2023-24859 era-compiler-vyper First Immutable Variable Initialization vulnerability CVSS 3.1MEDIUM 5.3
- TI-2024-23299 ZKsync Era evaluation order of Yul function arguments CVSS 3.1MEDIUM 5.3
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences