CVE-2026-114117: Vyper 0.3.8 through 0.5.0b1 Optimizer Miscompilation of msg.value | K in Ternary Branches

Published Oct 21, 2026
·
Updated

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 Software

1 affected component
Vyper Vyper>=0.3.8<=0.5.0b1

Event History

Oct 21, 2026
CVE Published
via MITRE·12:37 AM
Data Sourced
via MITRE·12:37 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which contracts are affected in practice?

Contracts compiled with Vyper versions 0.3.8 through 0.5.0b1 are affected if they use (msg.value | K) or (len(msg.data) | K), with K a nonzero integer literal, as a ternary-expression branch and were compiled with -O gas or -O codesize. -O gas is the default optimization setting.

2

Does exploitation require an attacker to have privileges or interact with a user?

No privileges or user interaction are required according to the supplied vector. Exploitation is network-accessible, but has high attack complexity; the vulnerable contract logic must be reachable in a way that makes the miscompiled ternary branch security-relevant.

3

What is the resulting behavior at runtime?

The affected expression is compiled as the constant 1 rather than its intended value. This can silently cause incorrect storage writes, arithmetic, indexes, return values, or events, without a warning or revert, and may incorrectly record deposits or lock funds.

4

How can teams determine whether deployed contracts are at risk?

Review the Vyper source and build settings for contracts compiled with affected versions. Look specifically for ternary branches containing (msg.value | K) or (len(msg.data) | K) where K is a nonzero integer literal, and confirm whether -O gas or -O codesize was used.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203