# CVE-2024-34704: era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.47%, higher than 42% of CVEs (2026-12-01)
- Published: 2024-05-13T19:13:27.510Z
- Modified: 2026-06-17T07:33:54.620Z
- Weaknesses: CWE-682
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- matter-labs era-compiler-solidity: >= 1.2.0, <= 1.4.0; from 1.2.0 before 1.4.1

## References

- <https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc>

## Sources

- CVE List: [CVE-2024-34704](https://www.cve.org/CVERecord?id=CVE-2024-34704), CVE Terms of Use, modified 2024-08-02
- NVD: [CVE-2024-34704](https://nvd.nist.gov/vuln/detail/CVE-2024-34704), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-34704 · Whole record: https://cve.day/CVE-2024-34704.json · Rebuilt by cve.day 2026-11-25T22:58:40.190Z
