Skip to main content
Vulnerability Database/CVE-2026-114118

CVE-2026-114118: Vyper Blueprint Privilege Escalation Flaw

CVE-2026-114118 is a privilege escalation vulnerability in Vyper that allows attackers to deploy contracts with no runtime code through blueprint size computation flaws. This post covers technical details, affected versions, and mitigation.

Published:

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-114118 Overview

CVE-2026-114118 affects the Vyper smart contract language, versions 0.3.4 through 0.5.0b1. The vulnerability resides in the create_from_blueprint builtin, which computes the remaining blueprint size using an unsigned 256-bit subtraction. The function does not verify that code_offset is less than the blueprint's code size. An attacker who controls code_offset can trigger an unsigned integer wraparound, causing the subtraction to produce a small positive value instead of a negative result. The affected factory then deploys a contract with no runtime code, which can permanently trap ETH and ERC-20 tokens sent to the resulting address [CWE-681].

Critical Impact

Attacker-controlled code_offset values cause factories built with vulnerable Vyper versions to deploy empty contracts, trapping any assets subsequently sent to them.

Affected Products

  • Vyper 0.3.4 through 0.5.0b1
  • Smart contracts compiled with vulnerable Vyper releases that call create_from_blueprint with untrusted code_offset
  • Factory contracts on EVM-compatible chains relying on blueprint deployment

Discovery Timeline

  • 2026-10-21 - CVE-2026-114118 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-114118

Vulnerability Analysis

The create_from_blueprint builtin in Vyper deploys a new contract by copying runtime code from an existing blueprint contract. The builtin accepts a code_offset argument that specifies where in the blueprint's bytecode the runtime section begins. To determine how many bytes to copy, the generated code subtracts code_offset from the blueprint's total code size.

The EVM operates on unsigned 256-bit integers. When code_offset is larger than the blueprint's code size, the subtraction underflows and wraps around to a very large positive value. In certain exploitation patterns, a carefully chosen offset instead produces a small positive length that bypasses validation checks downstream. The factory then calls CREATE or CREATE2 with a near-empty code region, deploying a contract whose runtime bytecode is empty or malformed.

Contracts deployed this way accept value transfers but cannot execute logic, so any ETH or tokens sent to the deployed address become unrecoverable.

Root Cause

The root cause is an incorrect calculation [CWE-681]: the compiler emits an unsigned subtraction without a preceding bounds check that code_offset < len(blueprint_code). This is a classic unsigned wraparound issue in low-level numeric handling.

Attack Vector

Exploitation requires that the factory contract pass a user-influenced value as code_offset to create_from_blueprint. An attacker submits a transaction supplying an offset greater than or equal to the blueprint's code size. The deployment proceeds without reverting and produces an address with no runtime code. Victims or protocol workflows that later send assets to the deployed contract lose those funds.

Technical details are available in the GitHub Security Advisory and the VulnCheck Advisory on Vyper Validation Bypass.

// No verified exploit code is published. See the GitHub Security Advisory
// (GHSA-fxg7-4wqg-c8gh) for proof-of-concept details and reproduction steps.

Detection Methods for CVE-2026-114118

Indicators of Compromise

  • Deployment transactions originating from Vyper-compiled factories that produce contract addresses with zero-length EXTCODESIZE.
  • Value transfers (ETH or ERC-20 transfer calls) directed to recently created contracts that have no runtime code.
  • Transactions invoking create_from_blueprint with code_offset values approaching or exceeding 2**256 - blueprint_size.

Detection Strategies

  • Audit deployed factory contracts for calls to create_from_blueprint where code_offset is derived from calldata, storage, or any externally influenced source.
  • Scan on-chain deployment history for child contracts whose runtime bytecode length is zero, correlated with the factory's address.
  • Review compiler metadata embedded in deployed Vyper contracts to identify versions in the 0.3.4 through 0.5.0b1 range.

Monitoring Recommendations

  • Instrument mempool monitoring to flag transactions calling vulnerable factories with abnormally large code_offset arguments.
  • Alert when newly deployed contracts receive value transfers within a short window after being created with empty bytecode.
  • Track Vyper advisory feeds and GHSA-fxg7-4wqg-c8gh for updated indicators and patched version information.

How to Mitigate CVE-2026-114118

Immediate Actions Required

  • Identify all production contracts compiled with Vyper 0.3.4 through 0.5.0b1 that use create_from_blueprint.
  • Pause or restrict factory entry points that accept an externally supplied code_offset until contracts are redeployed with a fixed compiler.
  • Add explicit bounds checks in Vyper source code to require code_offset < len(blueprint_code) before invoking create_from_blueprint.

Patch Information

Upgrade to a Vyper release that addresses the offset validation bypass. Refer to the GitHub Security Advisory for the fixed version and migration guidance. After upgrading, recompile and redeploy any affected factory contracts; existing on-chain bytecode cannot be patched in place.

Workarounds

  • Hardcode code_offset to a trusted constant when calling create_from_blueprint rather than accepting user input.
  • Wrap create_from_blueprint calls in a validator that asserts the offset is strictly less than the blueprint's code size before deployment.
  • Verify EXTCODESIZE of the newly created contract after deployment and revert the transaction if the result is zero.
bash
# Configuration example: pin a patched Vyper version in your build toolchain
pip install --upgrade "vyper>=0.5.0"
vyper --version

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.