{"id":"CVE-2026-114117","kind":"vulnerability","aliases":["CVE-2026-114117"],"related":[],"title":"Vyper: optimizer miscompiles msg.value expressions, corrupting contract state and funds","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.","summary":"Vyper versions 0.3.8 through 0.5.0b1 have an optimizer bug: when (msg.value | K) or (len(msg.data) | K) appears as a ternary branch, it compiles to the constant 1 under default gas or codesize optimization. Affected contracts can silently record wrong deposits, wrong storage values or wrong return values, which can lock funds.","severity":"high","cvss":8.2,"epss":0.00207,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["ethereum","package","python","smart-contracts","vyper"],"not_affected_if":["no-ternary-pattern","other-vyper-version"],"how_to_check":"- Check the Vyper compiler version in the project, for example `vyper --version` or the pinned version in `requirements.txt` or `pyproject.toml`.\n- Search Vyper source for ternary expressions that use `msg.value |` or `len(msg.data) |`.\n- unknown whether the sources list other checks.","fix":"- Upgrade Vyper to a release after `0.5.0b1` that contains the fix, then recompile and redeploy affected contracts.\n- unknown exact fixed version: the sources do not name it.","status":"open","published_at":"2026-10-21T01:17:38+00:00","first_seen_at":"2026-10-23T21:57:28+00:00","triaged_at":"2026-10-25T03:03:52+00:00","updated_at":"2026-10-25T03:03:52+00:00","category":"package","confidence":0.6,"triage":{"at":"2026-10-25T03:03:52Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade Vyper to a release after `0.5.0b1` that contains the fix, then recompile and redeploy affected contracts.\n- unknown exact fixed version: the sources do not name it.","reach":"internet","title":"Vyper: optimizer miscompiles msg.value expressions, corrupting contract state and funds","impact":"high","summary":"Vyper versions 0.3.8 through 0.5.0b1 have an optimizer bug: when (msg.value | K) or (len(msg.data) | K) appears as a ternary branch, it compiles to the constant 1 under default gas or codesize optimization. Affected contracts can silently record wrong deposits, wrong storage values or wrong return values, which can lock funds.","category":"package","nicknames":[],"who_cares":["vyper","smart-contracts","ethereum","python"],"confidence":0.6,"needs_auth":"no","worst_case":"Deployed contracts record wrong values and can lock user funds.","analyst_note":"Confirm the fixed Vyper release and any deployed-contract advisory at the NVD entry; the sources give no fixed version or check procedure.","how_to_check":"- Check the Vyper compiler version in the project, for example `vyper --version` or the pinned version in `requirements.txt` or `pyproject.toml`.\n- Search Vyper source for ternary expressions that use `msg.value |` or `len(msg.data) |`.\n- unknown whether the sources list other checks.","needs_analyst":true,"not_affected_if":["other-vyper-version","no-ternary-pattern"],"who_is_affected":"Projects that compile Vyper contracts with versions from 0.3.8 through 0.5.0b1 under the default gas or codesize optimization, and whose code uses a bitwise OR with msg.value or len(msg.data) inside a ternary branch. Contracts compiled with other Vyper versions, or that do not use this expression pattern, are not described as affected.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000694,"input_tokens":3438,"output_tokens":701,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-114117':13A,16A '-2026':12A,15A '0.3.8':26B,77C '0.5.0':28B,79C '1':51B,105C 'affect':58B,121C 'appear':41B 'arithmet':130C 'b1':29B,80C 'branch':45B,112C 'bug':33B 'codes':56B,120C 'compil':47B,101C 'constant':50B,104C 'contain':81C 'contract':7A,22B,59B,122C 'corrupt':6A 'cve':11A,14A 'default':53B,117C 'deposit':64B,143C 'ethereum':17B 'event':135C 'express':5A,111C 'fund':10A,75B,147C 'gas':54B,115C 'incorrect':144C 'index':131C 'integ':98C 'k':36B,40B,88C,92C,94C 'len':38B,90C 'liter':99C 'lock':74B,146C 'miscompil':3A,84C 'msg.data':39B,91C 'msg.value':4A,35B,87C 'nonzero':97C 'o':114C,119C 'optim':2A,32B,57B,83C 'packag':18B 'python':19B 'record':62B,142C 'return':70B,132C 'revert':139C 'silent':61B 'smart':21B 'smart-contract':20B 'state':8A 'storag':66B,128C 'ternari':44B,110C 'use':107C,123C 'valu':67B,71B,126C,133C 'version':25B 'vyper':1A,23B,24B,76C 'warn':137C 'without':136C 'write':129C 'wrong':63B,65B,69B,125C","nicknames":[],"mitigations":[],"who_affected":"Projects that compile Vyper contracts with versions from 0.3.8 through 0.5.0b1 under the default gas or codesize optimization, and whose code uses a bitwise OR with msg.value or len(msg.data) inside a ternary branch. Contracts compiled with other Vyper versions, or that do not use this expression pattern, are not described as affected.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-21T01:17:38+00:00","kev":null,"cvss_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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-114117","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-114117","severity":null,"published_at":"2026-10-21T01:17:38+00:00","modified_at":"2026-10-22T17:00:33+00:00","first_seen_at":"2026-10-23T21:57:28+00:00","fetched_at":"2026-10-23T22:29:01+00:00","note":null},{"source":"epss","external_id":"CVE-2026-114117","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-114117","severity":null,"published_at":null,"modified_at":null,"first_seen_at":"2026-10-24T13:15:54+00:00","fetched_at":"2026-10-24T13:15:54+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}