CVE-2021-41122
JSON

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 packageVersionsReported by
vyperlang vyper< 0.3.0, before 0.3.0CVE List, NVD
vyper (PyPI)before 0.3.0GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
GitHub4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
NVD4.0medium CVSS:2.0AV: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

Sources

SourceRecordLicence
CVE ListCVE-2021-41122 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-c7pr-343r-5c46 changed 2026-07-08CC-BY-4.0
NVDCVE-2021-41122 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-366 changed 2023-11-08CC-BY-4.0