漏洞标题
vyper的范围(start,start + N)对于负数会反转
漏洞描述信息
Vyper是针对以太坊虚拟机的Python风格智能合约语言。从版本0.3.8到版本0.4.0b1之前,当遍历形如`range(start, start + N)`的范围时,如果`start`是负数,执行将始终回滚。这个问题是由于范围的代码生成插入了错误的断言`stmt.parse_For_range()`。当`start`是有符号的时,问题就出现了,这里使用了`le`(小于或等于)而不是`sle`(小于或等于,考虑符号),并且在比较时将`start`解释为无符号整数。如果它是一个负数,它的第255位被设置为1,因此被解释为一个非常大的无符号整数,从而使断言始终失败。任何具有`range(start, start + N)`的合约都会受到影响,其中`start`是一个可能为负的有符号整数。如果在提供负数`start`的情况下调用通过该循环,执行将回滚。版本0.4.0b1修复了这个问题。
CVSS信息
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
漏洞类别
可达断言
漏洞标题
vyper's range(start, start + N) reverts for negative numbers
漏洞描述信息
Vyper is a pythonic Smart Contract Language for the Ethereum virtual machine. Starting in version 0.3.8 and prior to version 0.4.0b1, when looping over a `range` of the form `range(start, start + N)`, if `start` is negative, the execution will always revert. This issue is caused by an incorrect assertion inserted by the code generation of the range `stmt.parse_For_range()`. The issue arises when `start` is signed, instead of using `sle`, `le` is used and `start` is interpreted as an unsigned integer for the comparison. If it is a negative number, its 255th bit is set to `1` and is hence interpreted as a very large unsigned integer making the assertion always fail. Any contract having a `range(start, start + N)` where `start` is a signed integer with the possibility for `start` to be negative is affected. If a call goes through the loop while supplying a negative `start` the execution will revert. Version 0.4.0b1 fixes the issue.
CVSS信息
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
漏洞类别
数值类型间的不正确转换
漏洞标题
Vyper 安全漏洞
漏洞描述信息
Vyper是EVM 的 Pythonic 智能合约语言。 Vyper 0.3.8至0.4.0b1之前版本存在安全漏洞,该漏洞源于stmt.parse_For_range()函数存在错误断言问题。
CVSS信息
N/A
漏洞类别
其他