vyper
cpe:2.3:a:vyper_project:vyper:*:*:*:*:*:*:*
- <= 0.4.0
A vulnerability exists in Vyper versions through 0.4.0 in the square root (`sqrt()`) function, which uses the Babylonian method to calculate square roots of decimal values. The issue arises from improper handling of the final states, causing `sqrt()` to incorrectly round up results. This vulnerability can affect applications that rely on `sqrt()` for boundary conditions. The problem has been addressed in version 0.4.1, and users are advised to upgrade as soon as the patched version is available.
The vulnerability can lead to incorrect rounding in the `sqrt()` function, which may disrupt applications that use this function to determine boundary conditions. This could result in unintended behavior in smart contracts that rely on precise decimal calculations.
The vulnerability can be reproduced by calling the `sqrt()` function with a decimal value that causes the calculation to oscillate between two states, such as 0.9999999998. This input will result in an incorrect rounded-up output of 0.9999999999, demonstrating the rounding issue.
Users should upgrade to Vyper version 0.4.1, where this vulnerability has been fixed.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.