漏洞标题
在zksolc中`fold (xor (shl 1, x), -1) -> (rotl ~1, x)`的错误优化
漏洞描述信息
zkSolc 是一个用于 ZKsync 的 Solidity 编译器。自2015年以来的所有LLVM版本,在启用优化的情况下运行时,都将`(xor (shl 1, x), -1)`折叠为`(rotl ~1, x)`。这里的`~1`被生成为一个无符号64位数字(`2^64-1`)。在EraVM目标上,这个数字被零扩展到256位,而实际上应该是符号扩展的。因此,编译器生成的结果是`rotl 2^64 - 1, x`而不是预期的`roti 2^256 - 1, x`。分析表明,到发布此警报时,没有合同受到影响。此问题已在版本1.5.3中得到解决。建议用户升级并重新部署所有合同。对于这个漏洞,目前没有已知的补救方法。
CVSS信息
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
漏洞类别
整数溢出或超界折返
漏洞标题
`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.
CVSS信息
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
漏洞类别
数值计算不正确
漏洞标题
ZKsync Era 安全漏洞
漏洞描述信息
ZKsync Era是Matter Labs开源的一个编译器。 ZKsync Era 1.5.3之前版本存在安全漏洞,该漏洞源于LLVM在优化过程中对特定指令处理不当,导致数值扩展错误,影响了EraVM上的合约执行。
CVSS信息
N/A
漏洞类别
其他