{"id":"CVE-2024-34704","summary":"era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization","details":"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.","aliases":["GHSA-22pj-7cvw-r3gc"],"modified":"2026-08-12T03:51:36.341006882Z","published":"2024-05-13T19:13:27.510Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-682"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/34xxx/CVE-2024-34704.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/34xxx/CVE-2024-34704.json"},{"type":"ADVISORY","url":"https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34704"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/matter-labs/era-compiler-solidity","events":[{"introduced":"0"},{"last_affected":"cd75c8a1c36b9992109d244bc5a10c0a098c04a8"}],"database_specific":{"extracted_events":[{"introduced":"1.2.0"},{"last_affected":"1.4.0"}],"source":"AFFECTED_FIELD"}}],"versions":["1.4.0","1.3.23"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-34704.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"}]}