Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-114117 Overview
CVE-2026-114117 is an optimizer miscompilation in the Vyper smart contract compiler affecting versions 0.3.8 through 0.5.0b1. The compiler incorrectly reduces expressions of the form (msg.value | K) or (len(msg.data) | K), where K is any nonzero integer literal, to the constant 1 when they appear as a ternary branch under -O gas (the default) or -O codesize. Affected contracts silently use the wrong value in storage writes, arithmetic, indexes, return values, and events. No warning or revert is produced. Deposits can be recorded incorrectly and funds can be locked inside affected contracts.
Critical Impact
Smart contracts compiled with vulnerable Vyper versions can silently corrupt on-chain state, misrecord deposits, and permanently lock user funds without any runtime error signal.
Affected Products
- Vyper compiler version 0.3.8
- Vyper compiler versions 0.3.9 through 0.4.x
- Vyper compiler version 0.5.0b1
Discovery Timeline
- 2026-10-21 - CVE-2026-114117 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-114117
Vulnerability Analysis
The flaw sits in Vyper's expression optimizer, which runs under both the default -O gas setting and the -O codesize setting. When the optimizer encounters a bitwise-OR expression (msg.value | K) or (len(msg.data) | K) used as a branch of a ternary conditional, it folds the subexpression to the constant 1 rather than preserving the runtime computation. The compiler emits bytecode that writes this incorrect constant into storage slots, arithmetic operations, array indexes, return values, and event payloads. Because the compiler produces no diagnostic and the resulting bytecode does not revert at runtime, affected logic executes silently with corrupted values. Downstream, this can misrecord deposit amounts, break accounting invariants, and leave native-token balances stranded in the contract. The weakness is classified under CWE-682: Incorrect Calculation.
Root Cause
The root cause is an unsound constant-folding transformation applied to the ternary-branch form of bitwise_or where one operand is msg.value or len(msg.data) and the other is a nonzero literal. The optimizer treats the OR result as though it collapses to 1, discarding the dynamic operand. This behavior is specific to the gas and codesize optimization passes and does not affect contracts compiled with optimization disabled.
Attack Vector
Exploitation does not require an attacker action in the traditional sense; any transaction that triggers the affected code path produces incorrect state. An external caller can submit a payable transaction whose msg.value or calldata length flows through the miscompiled ternary expression, causing the contract to record 1 instead of the actual value. Depending on the contract logic, this can under-credit depositors, inflate withdrawal entitlements for other users, or lock the deposited native tokens permanently. The vulnerability is reachable from the network attack surface of any affected deployed contract.
No verified proof-of-concept code is published in the referenced advisories. See the GitHub Security Advisory GHSA-6j9c-gvcw-74fj and the VulnCheck Advisory on Vyper Miscompilation for compiler-level reproduction details.
Detection Methods for CVE-2026-114117
Indicators of Compromise
- Storage slots, event logs, or return values containing the literal 1 where a msg.value or len(msg.data) derived amount is expected.
- Discrepancies between the native-token balance held by a contract and the sum of recorded deposits in its internal accounting.
- User reports of deposits being credited as 1 wei or 1 unit instead of the submitted amount.
Detection Strategies
- Audit Vyper source for ternary expressions whose branches contain msg.value | K or len(msg.data) | K with any nonzero literal K.
- Recompile affected contracts with optimization disabled and compare generated bytecode or diff on-chain execution traces to identify miscompiled branches.
- Scan deployed contract bytecode for Vyper compiler metadata matching versions 0.3.8 through 0.5.0b1 and flag payable or calldata-sensitive contracts for review.
Monitoring Recommendations
- Monitor on-chain events emitted by affected contracts for deposit or transfer amounts equal to 1 that correlate with higher msg.value transactions.
- Reconcile per-block contract balance changes against the sum of accounting events emitted by the contract.
- Alert on failed withdrawals or revert patterns tied to accounting underflow in contracts compiled with vulnerable Vyper versions.
How to Mitigate CVE-2026-114117
Immediate Actions Required
- Inventory all Vyper-compiled contracts and identify any built with versions 0.3.8 through 0.5.0b1.
- Pause or disable deposit functionality on affected deployed contracts until bytecode has been verified safe.
- Recompile and redeploy affected contracts using a patched Vyper release, migrating state where necessary.
Patch Information
Consult the GitHub Security Advisory GHSA-6j9c-gvcw-74fj for the fixed Vyper release and upgrade instructions. Because contract bytecode is immutable once deployed, patching the compiler is only part of the remediation; affected contracts must be redeployed from source compiled with a non-vulnerable toolchain.
Workarounds
- Compile with optimization disabled to bypass the miscompiled passes until upgrading to a patched compiler release.
- Refactor source to avoid using (msg.value | K) or (len(msg.data) | K) as a ternary branch, assigning the expression to an intermediate variable first.
- For deployed contracts that cannot be redeployed immediately, route user interactions through a wrapper contract that validates recorded amounts against msg.value before accepting the transaction.
# Configuration example: build without the vulnerable optimizer passes
vyper -O none contracts/MyContract.vy
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

