VAITP Dataset

← Back to the dataset

CVE-2026-101861

Unsafe eval() in Langflow schema enables code execution via malicious __repr__ objects.

  • CVSS 2.1
  • CWE-94
  • Design Defects
  • Remote

Langflow 1.0.16 before 1.12.0 and 0.0.94 before 1.12.0 contain an unsafe eval() vulnerability in schema.py that allows authenticated attackers to achieve code execution by placing a Python object with a malicious __repr__ method into component input options lists. The eval() sink is triggered when a component is converted into a LangChain tool via ComponentToolkit.get_tools(), including during custom component saves through the API, by interpolating options into a Literal type string that is passed directly to eval() without safe evaluation controls.

CVSS base score
2.1
Published
2026-09-28
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Design Defects
Subcategory
Poorly Designed Access Controls
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade Langflow to version 1.12.0 (or later), which removes the unsafe eval() usage.

Vulnerable code sample

from typing import List, Dict, Any

class ComponentToolkit:
    def __init__(self, options: Dict[str, List[Any]]):
        self.options = options

    def get_tools(self) -> List[Any]:
        tools = []
        for name, values in self.options.items():
            # VULNERABLE: unsafe eval of interpolated options string
            literal_type = eval(f"Literal[{', '.join(repr(v) for v in values)}]")
            tools.append((name, literal_type))
        return tools

Patched code sample

from typing import List, Dict, Any, Literal
import ast

class ComponentToolkit:
    def __init__(self, options: Dict[str, List[Any]]):
        self.options = options

    def get_tools(self) -> List[Any]:
        tools = []
        for name, values in self.options.items():
            # FIX: use ast.literal_eval on a safe constructed string
            repr_list = ", ".join(repr(v) for v in values)
            safe_str = f"Literal[{repr_list}]"
            literal_type = ast.literal_eval(safe_str)
            tools.append((name, literal_type))
        return tools

Cite this entry

@misc{vaitp:cve2026101861,
  title        = {{Unsafe eval() in Langflow schema enables code execution via malicious __repr__ objects.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-101861},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-101861/}}
}

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.