---
id: CVE-2026-114117
title: >-
  Vyper 0.3.8 through 0.5.0b1 Optimizer Miscompilation of msg.value | K in
  Ternary Branches
summary: >-
  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…
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N'
cvssSource: cna
cwe:
  - CWE-682
vendor: vyperlang
product: vyper
affected:
  - vyper >= 0.3.8 <= 0.5.0b1
published: '2026-10-21'
updated: '2026-10-21'
sourceUpdated: '2026-10-21T00:37:14.741Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-114117'
references:
  - url: 'https://github.com/vyperlang/vyper/security/advisories/GHSA-6j9c-gvcw-74fj'
    label: GitHub Security Advisory (GHSA-6j9c-gvcw-74fj)
  - url: >-
      https://www.vulncheck.com/advisories/vyper-0.3.8-through-0.5-0b1-optimizer-miscompilation-of-msg-value-k-in-ternary-branches
    label: >-
      VulnCheck Advisory: Vyper 0.3.8 through 0.5.0b1 Optimizer Miscompilation
      of msg.value | K in Ternary Branches
tags:
  - cve.org
ingestedAt: '2026-10-21T01:37:08.009Z'
---

## Overview

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.

## Affected

- `vyper >= 0.3.8 <= 0.5.0b1`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
