{"answers":{"affected":"It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45056 exists.","fix":"No fix has been published for CVE-2024-45056 yet. Limit exposure of the affected software until one is available.","what":"CVE-2024-45056 is a medium-severity vulnerability in matter-labs era-compiler-solidity, published on 29 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-45056 and fix it if it is affected.\n\nWhat it is: CVE-2024-45056 is a medium-severity vulnerability in matter-labs era-compiler-solidity, published on 29 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45056 exists.\n\nAffected product: matter-labs era-compiler-solidity. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-45056/ (Markdown: https://insights.sbomify.com/CVE-2024-45056/index.md)","id":"CVE-2024-45056","markdown":"https://insights.sbomify.com/CVE-2024-45056/index.md","name":"CVE-2024-45056","record":{"aliases":["GHSA-fpx7-8vc6-frjj"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["other"],"network_reachable":"yes","non_default_config":true,"product_category":"Solidity compiler","requires_auth":"none","summary":"A compiler misoptimization in zksolc can generate incorrect bytecode for specific bitwise operations, potentially altering contract logic.","user_interaction":"not_required","vuln_class":"other"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"zksolc","vendor":"matter-labs"}],"cvss":{"score":5.9,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-682","name":"Incorrect Calculation"}],"description":"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.","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":false,"headline":"`fold (xor (shl 1, x), -1) -\u003e (rotl ~1, x)` misoptimization in zksolc","id":"CVE-2024-45056","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"other","year":"2024"},"n_packages":0,"n_references":2,"next":{"headline":"Reflected Cross-Site Scripting in i-Educar","id":"CVE-2024-45057"},"packages":[],"prev":{"headline":"Potential Permission Leakage of Cluster Level in hwameistor","id":"CVE-2024-45054"},"products":["era-compiler-solidity"],"published":"2024-08-29","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-29","vendors":["matter-labs"]},"summary":"A compiler misoptimization in zksolc can generate incorrect bytecode for specific bitwise operations, potentially altering contract logic.","url":"https://insights.sbomify.com/CVE-2024-45056/"}