Description
Vyper 0.3.8 through 0.5.0b1 contains an optimizer miscompilation in which (msg.value | K) or (len(msg.data) | K), where K is any nonzero integer literal, is compiled to the constant 1 when used as a ternary expression branch under -O gas (the default) or -O codesize. Affected contracts use the wrong value in storage writes, arithmetic, indexes, return values, or events without warning or revert, which can record deposits incorrectly and lock funds.
Published: 2026-10-21
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: Loss of Funds
Action: Patch Now
AI Analysis

Impact

Vyper 0.3.8 through 0.5.0b1 compiles expressions that combine msg.value or len(msg.data) with a non‑zero integer literal inside a ternary operator to the constant 1 when the gas or codesize optimizer is enabled. The incorrect value is used in storage writes, arithmetic, indexes, return values, or events, allowing funds to be recorded incorrectly, leading to locked or misallocated balances without any error or revert.

Affected Systems

This flaw impacts the Vyper compiler and any smart contracts compiled with Vyper versions 0.3.8 through 0.5.0b1. These contracts are typically deployed on the Ethereum network and use the default optimizer flags –O gas or -O codesize, common in production deployments.

Risk and Exploitability

The CVSS score of 8.2 denotes high severity, but the EPSS score of less than 1% and the absence from the KEV catalog imply a low current exploitation probability. The likely attack vector is a crafted transaction that invokes a vulnerable function containing a ternary expression with msg.value or len(msg.data); this inference is based on the description. If exploited, the miscompiled value of 1 will corrupt stored balances, return values or event logs, potentially locking funds or creating accounting errors. Because the flaw requires a specific ternary pattern, the attack surface is narrow but the potential loss for affected contracts is substantial.

Generated by OpenCVE AI on October 21, 2026 at 17:04 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Vyper to a version that includes the CVE fix (≥0.5.1 or later).
  • Re‑compile existing contracts with the optimizer disabled or rewrite ternary branches that use msg.value or len(msg.data) to avoid the miscompilation.
  • Deploy the patched contracts and migrate state, then audit contracts for previously frozen balances to ensure funds are correctly handled.

Generated by OpenCVE AI on October 21, 2026 at 17:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 21 Oct 2026 21:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 21 Oct 2026 00:45:00 +0000

Type Values Removed Values Added
Description Vyper 0.3.8 through 0.5.0b1 contains an optimizer miscompilation in which (msg.value | K) or (len(msg.data) | K), where K is any nonzero integer literal, is compiled to the constant 1 when used as a ternary expression branch under -O gas (the default) or -O codesize. Affected contracts use the wrong value in storage writes, arithmetic, indexes, return values, or events without warning or revert, which can record deposits incorrectly and lock funds.
Title Vyper 0.3.8 through 0.5.0b1 Optimizer Miscompilation of msg.value | K in Ternary Branches
First Time appeared Vyperlang
Vyperlang vyper
Weaknesses CWE-682
CPEs cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:*:*:*
Vendors & Products Vyperlang
Vyperlang vyper
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N'}

cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-10-21T20:12:04.759Z

Reserved: 2026-10-20T21:48:58.503Z

Link: CVE-2026-114117

cve-icon Vulnrichment

Updated: 2026-10-21T20:11:42.477Z

cve-icon NVD

Status : Deferred

Published: 2026-10-21T01:17:38.070

Modified: 2026-10-22T17:00:33.203

Link: CVE-2026-114117

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T10:41:35Z

Weaknesses