Vyper before 0.3.1 lacks a uint8 type, allowing interface return values declared as uint8, such as ERC20.decimals(), to be stored in uint256 variables...
Summary
Vyper interfaces returning integer types less than 256 bits can be manipulated if uint256 is used
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| vyperlangvyper |
< 0.3.1→ 0.3.1 |
0.3.1 |
| PyPIvyper |
≤ 0.1.0b16→ Not listed |
Not listed |
Original description The description as published by the source.
Vyper before 0.3.1 lacks a uint8 type, allowing interface return values declared as uint8, such as ERC20.decimals(), to be stored in uint256 variables without bounds checking. Malicious contracts can return values greater than 255 to manipulate or bypass contract logic that relies on these values.
Source: NIST National Vulnerability Database NVD GitHub Advisory
References
- advisory github.com
- advisory vulncheck.com
- web nvd.nist.gov
- web github.com