Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2025-26622 — vyper

🟢 CVSS 2.0 — Low ✅ No Known Exploit CWE-682 OSV
2.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Vyper's sqrt doesn't define rounding behavior

Vyper's 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.

the fix is tracked in https://github.com/vyperlang/vyper/pull/4486

Vulnerability Details

Vyper injects the following code to handle calculation of decimal sqrt. x is the input provided by user.

```python

assert x >= 0.0

z: decimal = 0.0

if x == 0.0:

z = 0.0

else:

z = x / 2.0 + 0.5

y: decimal = x

for i: uint256 in range(256):

if z == y:

break

y = z

z = (x / z + z) / 2.0

```

Notably, the terminal condition of the algorithm is either z_cur == z_prev, or the algorithm runs for 256 rounds.

However, for certain inputs, z might actually oscillate between N and N + epsilon, where N 2 <= x < (N + epsilon) 2. This means that the current behavior does not define whether it will round up or down to the nearest epsilon.

The example snippet here returns 0.9999999999, the rounded up result for sqrt(0.9999999998). This is due to the oscillation ending in N + epsilon instead of N.

```vyper

@external

def test():

d: decimal = 0.9999999998

r: decimal = sqrt(d) #this will be 0.9999999999

```

Note that sqrt() diverges from isqrt() here -- isqrt() consistently rounds down, so it is not subject to the same issue.

Impact Details

Since sqrt() can be used for determining boundary conditions, rounding down is preferred. However, since sqrt() is used very rarely in the wild, this advisory has been assigned an impact of low.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. No user interaction is required. Rated impact: confidentiality low, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Attack requirements: Present — the target has to be in a particular state for the attack to work.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: Low — limited, and the attacker does not choose what is affected.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2025-26622 is classified as CWE-682: Incorrect Calculation. The product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management.

Affected software

CVE-2025-26622 is recorded against 1 package.

  • vyper (fixed in 0.4.1)

Timeline and source

Published on 21 February 2025 and last revised on 17 June 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)

Other advisories for this package

vyper has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-682: Incorrect Calculation) in other software:

Details

Severity LOW
CVSS Score 2.0
CVSS Vector CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
CWE CWE-682
Public Exploit ✅ No
Source OSV
Published 2025-02-21
Updated 2026-08-20
Modified 2026-06-17

Affected Packages

Software From version Fixed in
vyper — 0.4.1

Similar Threats

Free Vulnerability Check

Is your site affected by CVE-2025-26622?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against CVE-2025-26622 and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2025
✓