VAITP Dataset

← Back to the dataset

CVE-2026-17632

Authenticated RCE in IBM Langflow due to improper AST scan validation.

  • CVSS 8.8
  • 94
  • Input Validation and Sanitization
  • Remote

IBM Langflow OSS 1.0.0 through 1.10.3 could allow a remote authenticated attacker to execute arbitrary code due to improper validation of Python code during AST-based security scanning.

CWE
94
CVSS base score
8.8
Published
2026-08-05
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
IBM Langflow
Fixed by upgrading
Yes

Solution

Upgrade to IBM Langflow OSS version 1.11.0 or later.

Vulnerable code sample

import ast

def execute_user_code(code: str):
    """
    Executes user-provided code after a security scan based on its AST.
    This is analogous to a custom component feature in a web application.
    """
    disallowed_nodes = (ast.Import, ast.ImportFrom)

    try:
        tree = ast.parse(code)

        for node in ast.walk(tree):
            # VULNERABLE: The AST scan only checks for import statements, but not for dangerous function calls like '__import__'.
            if isinstance(node, disallowed_nodes):
                raise ValueError("Disallowed construct: import statements are not permitted.")

        # If the scan passes, the code is executed in a restricted scope.
        # A payload like "__import__('os').system('id')" would still be executed.
        exec(code, {})

    except (ValueError, SyntaxError) as e:
        raise ValueError("Failed to execute code due to security or syntax constraints.") from e

Patched code sample

import ast

def execute_user_code(code: str):
    """
    Executes user-provided code after a security scan based on its AST.
    This is analogous to a custom component feature in a web application.
    """
    disallowed_nodes = (ast.Import, ast.ImportFrom)
    disallowed_call_names = {'__import__', 'eval', 'exec', 'open'}

    try:
        tree = ast.parse(code)

        for node in ast.walk(tree):
            if isinstance(node, disallowed_nodes):
                raise ValueError("Disallowed construct: import statements are not permitted.")

            # FIX: Also inspect Call nodes to block dangerous built-in functions by name.
            if isinstance(node, ast.Call) and isinstance(node.func, ast.Name):
                if node.func.id in disallowed_call_names:
                    raise ValueError(f"Disallowed construct: call to '{node.func.id}' is not permitted.")

        # If the scan passes, the code is executed in a restricted scope.
        exec(code, {})

    except (ValueError, SyntaxError) as e:
        raise ValueError("Failed to execute code due to security or syntax constraints.") from e

Payload

getattr(__import__('os'), 'system')('id')

Cite this entry

@misc{vaitp:cve202617632,
  title        = {{Authenticated RCE in IBM Langflow due to improper AST scan validation.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-17632},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-17632/}}
}
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 ::