Contract integrity loss via zero-extension miscompile
Published Aug 29, 2024 · Updated Aug 29, 2024
Incorrect calculation in Matter Labs ZKsync Solidity Compiler before 1.5.3 allows attackers to alter contract behavior via crafted source. The EraVM backend zero-extends LLVM's unsigned 64-bit ~1 rotate constant to 256 bits instead of sign-extending it, so optimized bit-clearing code rotates 2^64-1 rather than 2^256-1. The flaw requires optimizations and the affected shift/XOR pattern; it can change deployed bytecode semantics, although Matter Labs found no affected contracts.
Summary
What happened
Incorrect calculation in Matter Labs ZKsync Solidity Compiler before 1.5.3 allows attackers to alter contract behavior via crafted source. The EraVM backend zero-extends LLVM's unsigned 64-bit ~1 rotate constant to 256 bits instead of sign-extending it, so optimized bit-clearing code rotates 2^64-1 rather than 2^256-1. The flaw requires optimizations and the affected shift/XOR pattern; it can change deployed bytecode semantics, although Matter Labs found no affected contracts.
The record
- CVE
- CVE-2024-45056
- Published
- Aug 29, 2024
- Updated
- Aug 29, 2024
- Vendor
- Matter Labs
- Product
- ZKsync Solidity Compiler
- Classifications
- CWE-682
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Aug 29, 2024CVE publishedPublication date reported by the CVE source.
- Aug 29, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0 <1.5.3
- Affected versionversion=< 1.5.3
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Vendor-published Solidity miscompile reproducerproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo