{"id":"CVE-2024-34704","state":"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.","publishedAt":"2024-05-13T19:13:27.510Z","updatedAt":"2024-08-02T02:59:21.780Z","severity":{"score":5.9,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["matter-labs era-compiler-solidity"],"affected":[{"vendor":"matter-labs","product":"era-compiler-solidity","versions":[{"version":">= 1.2.0, <= 1.4.0","status":"affected"}]}],"references":["https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc"],"weaknesses":["CWE-682"],"ingestedAt":"2026-10-29T20:07:30.303Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/34xxx/CVE-2024-34704.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-34704","state":"PUBLISHED","datePublished":"2024-05-13T19:13:27.510Z","dateUpdated":"2024-08-02T02:59:21.780Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2024-05-07T13:53:00.132Z"},"containers":{"cna":{"title":"era-compiler-solidity contains a `xor(zext(cmp), -1)` misoptimization","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"matter-labs","product":"era-compiler-solidity","versions":[{"version":">= 1.2.0, <= 1.4.0","status":"affected"}]}],"references":[{"url":"https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc","name":"https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc","tags":["x_refsource_CONFIRM"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":5.9,"baseSeverity":"MEDIUM","confidentialityImpact":"NONE","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-682","lang":"en","description":"CWE-682: Incorrect Calculation","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2024-05-13T19:13:27.510Z"},"source":{"advisory":"GHSA-22pj-7cvw-r3gc","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"matter-labs","product":"era-compiler-solidity","defaultStatus":"unknown","versions":[{"version":"1.2.0","status":"affected","lessThan":"1.4.1","versionType":"custom"}],"cpes":["cpe:2.3:a:matter-labs:era-compiler-solidity:1.2.0:*:*:*:*:*:*:*"]}],"metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-34704","role":"CISA Coordinator","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-05-14T01:22:19.210870Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-04T17:42:30.012Z"}},{"title":"CVE Program Container","references":[{"url":"https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc","name":"https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-22pj-7cvw-r3gc","tags":["x_refsource_CONFIRM","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T02:59:21.780Z"}}]}}}