Vyper: Optimizer miscompilation of msg.value | K in ternary branches
Summary
Vyper versions 0.3.8 through 0.5.0b1 contain an optimizer bug. When (msg.value | K) or (len(msg.data) | K) is used as a branch of a ternary expression, the compiler replaces it with the constant 1 under the default -O gas and -O codesize settings, and emits no warning. An affected smart contract can then store, calculate, index or emit wrong values, for example recording deposits incorrectly and locking funds. The risk applies only to organisations that compile or operate affected Vyper smart contracts.
Affected
- Vyper 0.3.8 through 0.5.0b1 (affected range >= 0.3.8, <= 0.5.0b1)
- Default build settings -O gas and -O codesize
- Contracts that use msg.value or len(msg.data) combined with a nonzero integer literal (|) in a ternary expression
Fixed in
Unknown. No confirmed fixed release has been identified. The vendor advisory GHSA-6j9c-gvcw-74fj lists no patched version, and a patch-tracking issue (#5289) exists.
Workaround
- Recompile with the optimizer disabled (-O none), as reported in the advisory text; verify this against the original GHSA page.
- Rewrite ternary expressions that use msg.value or len(msg.data) so the value is assigned to a variable first.
- Redeploying or migrating already deployed contracts is required for these changes to take effect.
Exploitation
- CISA SSVC lists exploitation as 'poc' (proof of concept), automatable: no, technical impact: partial.
- Not known to be exploited in the wild.
- EPSS is low (0.00207 per Tenable).
Our recommendation
- Check whether your organisation builds or operates Vyper smart contracts, and which compiler version and build flags are used.
- Search the source code for ternary expressions that use msg.value or len(msg.data) with a bitwise OR.
- If affected, have the contracts reviewed by a Vyper or smart-contract auditor, apply the workaround, and recompile and redeploy or migrate before relying on the contracts with real funds.
- Monitor the GHSA advisory and the Vyper release list for a fixed version.
- For typical SME servers, workstations and network devices: no action needed.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-6j9c-gvcw-74fj github.com
- VulnCheck Advisory www.vulncheck.com
- OSV CVE-2026-114117 osv.dev
- VulDB 423955 vuldb.com
- Vyper issue #5289 (patch tracking) github.com
- Tenable CVE-2026-114117 www.tenable.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 15:18.
Original description (NVD)
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.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
