CVE-2021-41122: Bounds check missing for decimal args in Vyper
Impact
The following code does not properly validate that its input is in bounds.
python @external def foo(x: decimal) -> decimal: return x
Patches 0.3.0 / #2447
Workarounds Don't use decimal args
Other sources
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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/vyperto a version that resolves this vulnerability.Fixed in 0.3.0 - Upgrade
Upgrade
vyperto a version that resolves this vulnerability.Fixed in 0.3.0 - Configuration
Avoid using decimal-typed arguments in external functions in affected versions where decimal bounds are not properly validated.
Vyper smart contracts Use of decimal arguments in external functions = Do not use decimal args
Event History
Frequently Asked Questions
What is CVE-2021-41122?
CVE-2021-41122 is a vulnerability in Vyper, a Pythonic Smart Contract Language for the EVM.
What is the severity of CVE-2021-41122?
CVE-2021-41122 has a severity rating of 4.3 (medium).
How does CVE-2021-41122 affect Vyper users?
CVE-2021-41122 affects Vyper users who are using versions up to 0.2.10.
How can I fix CVE-2021-41122?
To fix CVE-2021-41122, users should upgrade to Vyper version 0.3.0 or later.
Where can I find more information about CVE-2021-41122?
More information about CVE-2021-41122 can be found in the Vyper GitHub repository and the associated security advisory.