VAITP Dataset

← Back to the dataset

CVE-2026-114116

Vyper misparses hidden line‑break chars, allowing attackers to alter numeric literals.

  • CVSS 6.0
  • CWE-436
  • Input Validation and Sanitization
  • Remote

Vyper 0.1.0b1 before 0.1.0b17 and 0.4.1 through 0.5.0b1 builds its source-line table with str.splitlines(), which treats characters like form feed and U+2028 as line breaks the Python parser ignores, so numeric literals are classified and validated from shifted source text. An attacker contributing source code can hide these characters in comments, strings or indentation to silently change address, integer or decimal constants.

CVSS base score
6.0
Published
2026-10-21
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Vyper
Fixed by upgrading
Yes

Solution

Upgrade Vyper to 0.5.0b2 or later (the fix is included starting with 0.5.0b2).

Vulnerable code sample

import vyper

def compile_contract(src: str):
    # VULNERABLE: uses splitlines which treats form feed as line break
    lines = src.splitlines()
    # Find the line defining the constant `value`
    for i, line in enumerate(lines):
        if "value:" in line:
            # Assume the literal follows the colon
            literal = line.split(":")[1].strip()
            value = int(literal)
            return value
    raise ValueError("constant not found")

# Contract source with a hidden form feed (U+000C) in a comment before the constant
contract = """\
# This contract demonstrates a hidden character
#\u000c This comment contains a form feed which splitlines sees as a new line
@external
def foo() -> uint256:
    value: uint256 = 42
    return value
"""

# The vulnerable function will mis‑interpret the line number and raise an error
compile_contract(contract)

Patched code sample

import vyper

def compile_contract(src: str):
    # FIX: use split on explicit newline to ignore form feed as line break
    lines = src.split('\n')
    # Find the line defining the constant `value`
    for i, line in enumerate(lines):
        if "value:" in line:
            # Assume the literal follows the colon
            literal = line.split(":")[1].strip()
            value = int(literal)
            return value
    raise ValueError("constant not found")

# Contract source with a hidden form feed (U+000C) in a comment before the constant
contract = """\
# This contract demonstrates a hidden character
#\u000c This comment contains a form feed which split will ignore
@external
def foo() -> uint256:
    value: uint256 = 42
    return value
"""

# The patched function correctly finds the constant
compile_contract(contract)

Cite this entry

@misc{vaitp:cve2026114116,
  title        = {{Vyper misparses hidden line‑break chars, allowing attackers to alter numeric literals.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-114116},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-114116/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.