CVE-2025-26622
Python vulnerability analysis and mitigation

Overview

Vyper, a Pythonic Smart Contract Language for the EVM, has identified a vulnerability in its sqrt() builtin function (CVE-2025-26622). The vulnerability was discovered and disclosed on February 21, 2025, affecting all versions up to 0.4.0. The issue stems from the improper handling of oscillating final states in the babylonian method used for calculating square roots of decimals (GitHub Advisory).

Technical details

The vulnerability occurs in the implementation of the babylonian method for square root calculation. The terminal condition of the algorithm either requires zcur == zprev or runs for 256 rounds. For certain inputs, the value of z can oscillate between N and N + epsilon, where N^2 <= x < (N + epsilon)^2. This oscillation can result in the function returning rounded up results instead of consistently rounding down (GitHub Advisory).

Impact

The impact of this vulnerability is considered low due to the rare usage of sqrt() in production environments. However, since sqrt() can be used for determining boundary conditions, the undefined rounding behavior could potentially affect applications that rely on precise square root calculations for boundary checks (GitHub Advisory).

Mitigation and workarounds

The issue is being addressed in version 0.4.1 of Vyper, which ensures the result is consistently rounded down. Users are advised to upgrade to version 0.4.1 when it becomes available. No workarounds are currently known for this vulnerability (GitHub PR).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management