CVE-2024-34704

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.

Category

5.9
CVSS
Severity: Medium
CVSS 3.1 •
EPSS 0.10%
Affected: matter-labs era-compiler-solidity
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2024-34704?
CVE-2024-34704 has been scored as a medium severity vulnerability.
How to fix CVE-2024-34704?
To fix CVE-2024-34704, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2024-34704 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2024-34704 is being actively exploited. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2024-34704?
CVE-2024-34704 affects matter-labs era-compiler-solidity.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.