{"id":"CVE-2024-34704","aliases":["EUVD-2024-34999","GHSA-22pj-7cvw-r3gc"],"status":"published","title":"era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization","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.","severity":{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00466,"percentile":0.40683,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-682"],"published":"2024-05-13T19:13:27Z","modified":"2026-10-28T02:31:01Z","products":[{"vendor":"matter-labs","product":"era-compiler-solidity"}],"references":[{"url":"https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc","tags":["x_refsource_CONFIRM","x_transferred","advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/34xxx/CVE-2024-34704.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34704","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2024-34704","title":"era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization","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.","status":"published","published":"2024-05-13T19:13:27.51Z","modified":"2024-08-02T02:59:21.78Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-682"],"updated_at":"2026-11-02T14:34:23.193864Z"}],"euvd":[{"id":"EUVD-2024-34999","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.","status":"published","published":"2024-05-13T19:13:27Z","modified":"2024-08-02T02:59:21Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-03T03:50:20.898281Z"}],"nvd":[{"id":"CVE-2024-34704","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.","status":"published","published":"2024-05-14T15:39:29.56Z","modified":"2026-06-17T07:33:54.62Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-682"],"updated_at":"2026-11-02T14:09:58.124007Z"}],"osv":[{"id":"CVE-2024-34704","title":"era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization","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.","status":"published","published":"2024-05-13T19:13:27.51Z","modified":"2026-10-28T02:31:01.477053364Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-682"],"updated_at":"2026-11-02T15:44:40.391953Z"}]}}
