CVE-2024-45056`fold (xor (shl 1, x), -1) -> (rotl ~1, x)` misoptimization in zksolc
zksolc is a Solidity compiler for ZKsync. All LLVM versions since 2015 fold `(xor (shl 1, x), -1)` to `(rotl ~1, x)` if run with optimizations enabled. Here `~1` is generated as an unsigned 64 bits number (`2^64-1`). This number is zero-extended to 256 bits on EraVM target while it should have been sign-extended. Thus instead of producing `roti 2^256 - 1, x` the compiler produces `rotl 2^64 - 1, x`. Analysis has shown that no contracts were affected by the date of publishing this advisory. This issue has been addressed in version 1.5.3. Users are advised to upgrade and redeploy all contracts. There are no known workarounds for this vulnerability.
What to do
None of the Linux distributions or Windows releases we track list an affected package for this CVE. Check the vendor-reported products below.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | llvm-toolchain-14 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | llvm-toolchain-15 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | llvm-toolchain-16 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | llvm-toolchain-17 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | llvm-toolchain-18 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | llvm-toolchain-19 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | llvm-toolchain-11 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | llvm-toolchain-12 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | llvm-toolchain-13 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | llvm-toolchain-14 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | llvm-toolchain-15 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-10 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-11 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-12 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-18 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-6.0 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-7 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-8 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | llvm-toolchain-9 | Not affected vulnerable_code_not_present |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- matter-labs era-compiler-solidity: affected: < 1.5.3
References
- https://github.com/matter-labs/era-compiler-solidity/security/advisories/GHSA-fpx7-8vc6-frjj
- https://github.com/llvm/llvm-project/commit/e48237df95b49a36b8ffceb78c8a58f4be1b4344
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.