Vulnerability · Published Feb 21, 2025 · Assigned by GitHub_M
CVE-2025-26622sqrt doesn't define rounding behavior in Vyper
High 7.5
In plain English
A high-severity security flaw in vyper from vyperlang. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 26% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
vyper is a Pythonic Smart Contract Language for the EVM. Vyper `sqrt()` builtin uses the babylonian method to calculate square roots of decimals. Unfortunately, improper handling of the oscillating final states may lead to sqrt incorrectly returning rounded up results. This issue is being addressed and a fix is expected in version 0.4.1. Users are advised to upgrade as soon as the patched release is available. There are no known workarounds for this vulnerability.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | vyper | 0.4.1 | GHSA-2p94-8669-xg86 |
| PyPI | vyper | 0.4.1 | PYSEC-2025-29 |
Affected products (as reported)
Weakness: CWE-682 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://github.com/vyperlang/vyper/security/advisories/GHSA-2p94-8669-xg86 x_refsource_CONFIRM
- https://github.com/vyperlang/vyper/pull/4486 x_refsource_MISC