{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-34704","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 ","descriptionLong":"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.","published":"2024-05-13T19:13:27.510Z","updated":"2026-10-28T02:31:01.477053364Z","reserved":"2024-05-07T13:53:00.132Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"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","rating":"medium","source":"GitHub_M"},"metrics":[{"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","rating":"medium","source":"GitHub_M"},{"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","rating":"medium","source":"github.com"},{"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","rating":"medium","source":"OSV"}],"rating":"medium","products":["matter-labs era-compiler-solidity"],"affectedProducts":[{"vendor":"matter-labs","product":"era-compiler-solidity","defaultStatus":null,"versions":[{"version":">= 1.2.0, <= 1.4.0","status":"affected"}],"platforms":[]}],"packages":[],"cwes":["CWE-682"],"aliases":["GHSA-22pj-7cvw-r3gc"],"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"]}],"patchReferenced":false,"fixAvailable":false,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00466,"epssPercentile":0.41123,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-34704","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34704","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-34704","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-34704","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}