vyperlang/vyper · Security
missing clamps for decimal args in external functions
- GHSA ID
- GHSA-c7pr-343r-5c46
- CVE ID
- CVE-2021-41122
- Severity
- medium
- Published
- Updated
- CVSS
- 4.3 · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
- CVSS v3
- 4.3 · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
- CVSS v4
- 5.3 · CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Description
Impact
The following code does not properly validate that its input is in bounds.
@external
def foo(x: decimal) -> decimal:
return x
Patches
0.3.0 / #2447
Workarounds
Don't use decimal args
CWEs
- CWE-682 · Incorrect Calculation
References
- https://github.com/vyperlang/vyper/security/advisories/GHSA-c7pr-343r-5c46 ↗
- https://github.com/vyperlang/vyper/pull/2447 ↗
- https://nvd.nist.gov/vuln/detail/CVE-2021-41122 ↗
- https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2021-366.yaml ↗
- https://github.com/advisories/GHSA-c7pr-343r-5c46 ↗