4.3medium
Bounds check missing for decimal args in Vyper
- Severity
- 4.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.80% (higher than 57% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-c7pr-343r-5c46PYSEC-2021-366
Description
Vyper is a Pythonic Smart Contract Language for the EVM. In affected versions external functions did not properly validate the bounds of decimal arguments. The can lead to logic errors. This issue has been resolved in version 0.3.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vyperlang vyper | < 0.3.0, before 0.3.0 | CVE List, NVD |
| vyper (PyPI) | before 0.3.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 4.0medium CVSS:2.0 | AV:N/AC:L/Au:S/C:N/I:P/A:N |
Classification
What each source says
CVE List
Vyper is a Pythonic Smart Contract Language for the EVM. In affected versions external functions did not properly validate the bounds of decimal arguments. The can lead to logic errors. This issue has been resolved in version 0.3.0.
GitHub Advisory Database
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
NVD (es)
Vyper es un lenguaje de contrato inteligente de Python para el EVM. En las versiones afectadas, las funciones externas no comprueban correctamente los límites de los argumentos decimales. Esto puede conllevar a errores lógicos. Este problema ha sido resuelto en la versión 0.3.0
References
| https://github.com/vyperlang/vyper/security/advisories/GHSA-c7pr-343r-5c46 | advisory, exploit, third-party-advisory, web | |
| https://github.com/vyperlang/vyper/pull/2447 | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-41122 | advisory | |
| https://github.com/pypa/advisory-database/tree/main/vulns/vyper/PYSEC-2021-366.yaml | web | |
| https://github.com/vyperlang/vyper | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-41122 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-c7pr-343r-5c46 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-41122 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-366 changed 2023-11-08 | CC-BY-4.0 |